aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-01-29 22:26:08 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-01-29 22:26:08 +0000
commita367e9de80eb05e78f06dc35c1e050799e735282 (patch)
tree3d7a73d0ea47b3123f80d52dbc6ce004ca047e7d /lib/Sema/SemaDecl.cpp
parent6933e3b037fcb15b68f41d2b91ee01db45a2d43a (diff)
Move -Wstatic-float-init fixit into a note & don't recover as if constexpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173841 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 702d38280a..60b67602c3 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -7203,15 +7203,12 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
// In C++98, this is a GNU extension. In C++11, it is not, but we support
// it anyway and provide a fixit to add the 'constexpr'.
if (getLangOpts().CPlusPlus11) {
- SemaDiagnosticBuilder D = Diag(VDecl->getLocation(),
- diag::ext_in_class_initializer_float_type_cxx11);
- D << DclT << Init->getSourceRange();
- if (Diags.getDiagnosticLevel(diag::warn_initializer_out_of_order,
- VDecl->getLocation()) >=
- DiagnosticsEngine::Error) {
- D << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr ");
- VDecl->setConstexpr(true);
- }
+ Diag(VDecl->getLocation(),
+ diag::ext_in_class_initializer_float_type_cxx11)
+ << DclT << Init->getSourceRange();
+ Diag(VDecl->getLocStart(),
+ diag::note_in_class_initializer_float_type_cxx11)
+ << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr ");
} else {
Diag(VDecl->getLocation(), diag::ext_in_class_initializer_float_type)
<< DclT << Init->getSourceRange();