diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-11-02 01:34:28 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-11-02 01:34:28 +0000 |
commit | cef3a7bf84817c58c7666df9e87199b9a6b8b9a3 (patch) | |
tree | 5643463f1af269bf8413dd7309a8635fb010eaea /lib/Parse/ParseDecl.cpp | |
parent | e579328ec9a95acc7f181e04c58a747ba001d80f (diff) |
Change diagnostics for enums with fixed underlying type so in C++98 mode, we cite C++11.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index bb5f333749..7b4fbfc287 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -3233,11 +3233,14 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, SourceRange Range; BaseType = ParseTypeName(&Range); - if (!getLangOpts().CPlusPlus0x && !getLangOpts().ObjC2) - Diag(StartLoc, diag::ext_ms_enum_fixed_underlying_type) - << Range; - if (getLangOpts().CPlusPlus0x) + if (getLangOpts().CPlusPlus0x) { Diag(StartLoc, diag::warn_cxx98_compat_enum_fixed_underlying_type); + } else if (!getLangOpts().ObjC2) { + if (getLangOpts().CPlusPlus) + Diag(StartLoc, diag::ext_cxx11_enum_fixed_underlying_type) << Range; + else + Diag(StartLoc, diag::ext_c_enum_fixed_underlying_type) << Range; + } } } |