summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-07-24 20:24:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-07-24 20:24:58 +0000
commit7ac3c6af87e479f1f28eb4b71d7aa053c456e711 (patch)
treeb89ff72e836528907b2ecc977dd55a80320bc30c /clang/lib/Sema/DeclSpec.cpp
parent5b8c1680de0635dcaecd930ea48f5e54f70a7021 (diff)
downloadbcm5719-llvm-7ac3c6af87e479f1f28eb4b71d7aa053c456e711.tar.gz
bcm5719-llvm-7ac3c6af87e479f1f28eb4b71d7aa053c456e711.zip
Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11
unless they appear in a decl-specifier-seq. llvm-svn: 160688
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 3cce8cb4449..f3ec5656ea3 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -668,9 +668,11 @@ bool DeclSpec::SetTypeSpecError() {
}
bool DeclSpec::SetTypeQual(TQ T, SourceLocation Loc, const char *&PrevSpec,
- unsigned &DiagID, const LangOptions &Lang) {
- // Duplicates turn into warnings pre-C99.
- if ((TypeQualifiers & T) && !Lang.C99)
+ unsigned &DiagID, const LangOptions &Lang,
+ bool IsTypeSpec) {
+ // Duplicates are permitted in C99, and are permitted in C++11 unless the
+ // cv-qualifier appears as a type-specifier.
+ if ((TypeQualifiers & T) && !Lang.C99 && (!Lang.CPlusPlus0x || IsTypeSpec))
return BadSpecifier(T, T, PrevSpec, DiagID);
TypeQualifiers |= T;
OpenPOWER on IntegriCloud