aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorSirraide <aeternalmail@gmail.com>2025-04-02 08:29:05 +0200
committerGitHub <noreply@github.com>2025-04-02 08:29:05 +0200
commit076397ff3217cf45fd08024dd7bcd2bc8fb229ab (patch)
tree1e58ec11e532b1d8e96276045e13765420d28d47 /clang/lib/Parse/ParseDecl.cpp
parenta2ca2f3f10002da61e9860d0ce11e0272482baba (diff)
downloadllvm-076397ff3217cf45fd08024dd7bcd2bc8fb229ab.zip
llvm-076397ff3217cf45fd08024dd7bcd2bc8fb229ab.tar.gz
llvm-076397ff3217cf45fd08024dd7bcd2bc8fb229ab.tar.bz2
Revert "[Clang] [NFC] Introduce a helper for emitting compatibility diagnostics" (#134036)
Reverts llvm/llvm-project#132348 Some tests are failing and I still need to figure out what is going on here.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index d77400e..3f15640 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -5452,8 +5452,11 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
BaseRange = SourceRange(ColonLoc, DeclaratorInfo.getSourceRange().getEnd());
if (!getLangOpts().ObjC) {
- if (getLangOpts().CPlusPlus)
- DiagCompat(ColonLoc, diag_compat::enum_fixed_underlying_type)
+ if (getLangOpts().CPlusPlus11)
+ Diag(ColonLoc, diag::warn_cxx98_compat_enum_fixed_underlying_type)
+ << BaseRange;
+ else if (getLangOpts().CPlusPlus)
+ Diag(ColonLoc, diag::ext_cxx11_enum_fixed_underlying_type)
<< BaseRange;
else if (getLangOpts().MicrosoftExt && !getLangOpts().C23)
Diag(ColonLoc, diag::ext_ms_c_enum_fixed_underlying_type)