diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-09 05:55:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-09 05:55:43 +0000 |
commit | afee0ff915b87f92e8c07c72d31c3165aacf6fa8 (patch) | |
tree | 2fed8ddc743f0cd0d4e38687a14033531b4c3438 /lib/Sema/SemaDeclCXX.cpp | |
parent | 569cdc82c1a99fe1e950a1ddbe5ff82df0b13f3d (diff) |
PR14550: If a system header contains a bogus constexpr function definition,
don't mark the function as invalid, since we suppress the error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 5cca43b548..6f1b489a2d 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -994,11 +994,12 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { // base class sub-objects shall be a constexpr constructor. llvm::SmallVector<PartialDiagnosticAt, 8> Diags; if (!Expr::isPotentialConstantExpr(Dcl, Diags)) { - Diag(Dcl->getLocation(), diag::err_constexpr_function_never_constant_expr) + Diag(Dcl->getLocation(), diag::ext_constexpr_function_never_constant_expr) << isa<CXXConstructorDecl>(Dcl); for (size_t I = 0, N = Diags.size(); I != N; ++I) Diag(Diags[I].first, Diags[I].second); - return false; + // Don't return false here: we allow this for compatibility in + // system headers. } return true; |