From f86b5dc7009e7686fc31ff0d1e8a7bff138607cd Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 9 Dec 2012 05:55:43 +0000 Subject: PR14550: If a system header contains a bogus constexpr function definition, don't mark the function as invalid, since we suppress the error. llvm-svn: 169689 --- clang/lib/Sema/SemaDeclCXX.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaDeclCXX.cpp') diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 5cca43b5480..6f1b489a2d2 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/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 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(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; -- cgit v1.2.3