DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166152 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp
index 971fc72..b3066eb 100644
--- a/lib/Sema/DeclSpec.cpp
+++ b/lib/Sema/DeclSpec.cpp
@@ -680,15 +680,13 @@
}
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);
}