aboutsummaryrefslogtreecommitdiff
path: root/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
commitd654f2d722d4cb6366edcb8f27e99745fcbae486 (patch)
tree9b78a2b6e55ca9a73f5b90e4ede4104d3ca7a641 /lib/Sema/DeclSpec.cpp
parent07c90ede8069029b956a2f667282fa0ce1382c4b (diff)
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
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
-rw-r--r--lib/Sema/DeclSpec.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp
index 971fc721c1..b3066eb080 100644
--- a/lib/Sema/DeclSpec.cpp
+++ b/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);
}