diff options
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 11 |
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; } } |