From: Richard Smith Date: Thu, 5 Apr 2012 18:57:10 +0000 (+0000) Subject: Temporary workaround for bug#12457: turn the 'constexpr function never produces X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e47029aead7afc823d4e2eaba00bce39f929a858;p=clang Temporary workaround for bug#12457: turn the 'constexpr function never produces a constant expression' error into a DefaultError ExtWarn, so that it can be disabled and is suppressed in system headers. libstdc++4.7 contains some such functions which we currently can't evaluate as constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154115 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index a89217c472..30173fb7ba 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1371,9 +1371,9 @@ def err_constexpr_vla : Error< "%select{function|constructor}1">; def err_constexpr_var_declaration : Error< "variables cannot be declared in a constexpr %select{function|constructor}0">; -def err_constexpr_function_never_constant_expr : Error< - "constexpr %select{function|constructor}0 never produces " - "a constant expression">; +def err_constexpr_function_never_constant_expr : ExtWarn< + "constexpr %select{function|constructor}0 never produces a " + "constant expression">, InGroup>, DefaultError; def err_constexpr_body_no_return : Error< "no return statement in constexpr function">; def err_constexpr_body_multiple_return : Error< diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp index 133d944706..fd17d35677 100644 --- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp +++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -fcxx-exceptions %s +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -fcxx-exceptions -Wno-invalid-constexpr %s namespace StdExample {