aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2013-04-23 02:47:36 +0000
committerRichard Trieu <rtrieu@google.com>2013-04-23 02:47:36 +0000
commited5a292592c61f1b0d2da60dddea2fc11fb3f157 (patch)
treebd9bd7fbe6b36d4819bf3db342e0f98c430a2155 /lib/Parse/ParseDecl.cpp
parent2545b1d99942080bac4a74cda92c620123d0d6e9 (diff)
Warn that scoped enumerations are a C++11 extenstion when compiling in
C++98 mode. This improves on the previous diagnostic message of: error: expected identifier or '{' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 1215e36824..697e95a73e 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -3367,9 +3367,9 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
bool IsScopedUsingClassTag = false;
// In C++11, recognize 'enum class' and 'enum struct'.
- if (getLangOpts().CPlusPlus11 &&
- (Tok.is(tok::kw_class) || Tok.is(tok::kw_struct))) {
- Diag(Tok, diag::warn_cxx98_compat_scoped_enum);
+ if (Tok.is(tok::kw_class) || Tok.is(tok::kw_struct)) {
+ Diag(Tok, getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_scoped_enum
+ : diag::ext_scoped_enum);
IsScopedUsingClassTag = Tok.is(tok::kw_class);
ScopedEnumKWLoc = ConsumeToken();