aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaDecl.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/Sema/SemaDecl.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/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 9b7b3f8..bbefbbf 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7649,7 +7649,10 @@ NamedDecl *Sema::ActOnVariableDeclarator(
IsVariableTemplate = true;
// Only C++1y supports variable templates (N3651).
- DiagCompat(D.getIdentifierLoc(), diag_compat::variable_template);
+ Diag(D.getIdentifierLoc(),
+ getLangOpts().CPlusPlus14
+ ? diag::compat_cxx14_variable_template
+ : diag::compat_pre_cxx14_variable_template);
}
}
} else {
@@ -7715,8 +7718,10 @@ NamedDecl *Sema::ActOnVariableDeclarator(
} else if (RD->isUnion()) {
// C++98 [class.union]p1: If a union contains a static data member,
// the program is ill-formed. C++11 drops this restriction.
- DiagCompat(D.getIdentifierLoc(),
- diag_compat::static_data_member_in_union)
+ Diag(D.getIdentifierLoc(),
+ getLangOpts().CPlusPlus11
+ ? diag::compat_cxx11_static_data_member_in_union
+ : diag::compat_pre_cxx11_static_data_member_in_union)
<< Name;
}
}