aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 09:15:49 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 09:15:49 +0000
commit672edb0a04a5273e3a501f3b196844c125290780 (patch)
treed0a9753ee5f1653cf02709b2d767b72f54ee70e1 /lib/Parse/ParseDeclCXX.cpp
parent4e1125f630e75a52209b928e9d43b638abf39987 (diff)
Don't accidentally and silently accept C++11 attributes in decl-specifier-seqs
in C++98. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 90926a362b..f040b9bfff 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -3186,6 +3186,8 @@ void Parser::ParseCXX11AttributeSpecifier(ParsedAttributes &attrs,
/// attribute-specifier-seq[opt] attribute-specifier
void Parser::ParseCXX11Attributes(ParsedAttributesWithRange &attrs,
SourceLocation *endLoc) {
+ assert(getLangOpts().CPlusPlus11);
+
SourceLocation StartLoc = Tok.getLocation(), Loc;
if (!endLoc)
endLoc = &Loc;