summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-17 23:31:46 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-17 23:31:46 +0000
commit87e795174cc59df488487a541fda44406d8e9224 (patch)
treef0ad4a7d8ed27df79a689b77a616d9cb6d9c9c4f /clang/lib/Sema/DeclSpec.cpp
parent5969c680f59f2adf977f0edf1710c2077ea0c76d (diff)
downloadbcm5719-llvm-87e795174cc59df488487a541fda44406d8e9224.tar.gz
bcm5719-llvm-87e795174cc59df488487a541fda44406d8e9224.zip
DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.
llvm-svn: 166152
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 971fc721c1c..b3066eb0801 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -680,15 +680,13 @@ bool DeclSpec::SetTypeSpecError() {
}
bool DeclSpec::SetTypeQual(TQ T, SourceLocation Loc, const char *&PrevSpec,
- 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. However, since this is likely
- // not what the user intended, we will always warn. We do not need to set the
- // qualifier's location since we already have it.
+ unsigned &DiagID, const LangOptions &Lang) {
+ // Duplicates are permitted in C99, but are not permitted in C++. However,
+ // since this is likely not what the user intended, we will always warn. We
+ // do not need to set the qualifier's location since we already have it.
if (TypeQualifiers & T) {
bool IsExtension = true;
- if (Lang.C99 || (Lang.CPlusPlus0x && !IsTypeSpec))
+ if (Lang.C99)
IsExtension = false;
return BadSpecifier(T, T, PrevSpec, DiagID, IsExtension);
}
OpenPOWER on IntegriCloud