On Thu, Mar 29, 2012 at 4:39 PM, Eli Friedman <[email protected]>wrote:
> Author: efriedma > Date: Thu Mar 29 18:39:39 2012 > New Revision: 153703 > > URL: http://llvm.org/viewvc/llvm-project?rev=153703&view=rev > Log: > Extend -Wc++11-narrowing to cover converted constant expressions as well > as braced-initializers. <rdar://problem/11121178>. > > > Added: > cfe/trunk/test/CXX/expr/expr.const/p3-0x-nowarn.cpp > Modified: > cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td > cfe/trunk/lib/Sema/SemaOverload.cpp > > Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=153703&r1=153702&r2=153703&view=diff > > ============================================================================== > --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) > +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Mar 29 > 18:39:39 2012 > @@ -27,7 +27,12 @@ > def err_expr_not_cce : Error< > "%select{case value|enumerator value|non-type template argument}0 " > "is not a constant expression">; > -def err_cce_narrowing : Error< > +def err_cce_narrowing : ExtWarn< > + "%select{case value|enumerator value|non-type template argument}0 " > + "%select{cannot be narrowed from type %2 to %3|" > + "evaluates to %2, which cannot be narrowed to type %3}1">, > + InGroup<CXX11Narrowing>, DefaultError; > +def err_cce_narrowing_sfinae : Error< > "%select{case value|enumerator value|non-type template argument}0 " > "%select{cannot be narrowed from type %2 to %3|" > "evaluates to %2, which cannot be narrowed to type %3}1">; > We do this sort of thing often enough that we should probably have tablegen support for it. Could we promote all diagnostics with SFINAE=0 to errors when they occur in SFINAE contexts, and mark cases like this as ExtWarn<...>, DefaultError, NoSFINAE; ?
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
