[cfe-commits] r146406 - in /cfe/trunk: include/clang/Basic/DiagnosticASTKinds.td test/SemaCXX/constant-expression-cxx11.cpp

Richard Smith richard-llvm at metafoo.co.uk
Mon Dec 12 11:33:27 PST 2011


Author: rsmith
Date: Mon Dec 12 13:33:27 2011
New Revision: 146406

URL: http://llvm.org/viewvc/llvm-project?rev=146406&view=rev
Log:
Further tweaking of diagnostic text for casts performing reinterpret_cast
conversions in constant expressions.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
    cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td?rev=146406&r1=146405&r2=146406&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td Mon Dec 12 13:33:27 2011
@@ -13,8 +13,8 @@
 //  "C does not permit evaluated commas in an integer constant expression">;
 def note_expr_divide_by_zero : Note<"division by zero">;
 def note_constexpr_invalid_cast : Note<
-  "%select{reinterpret_cast|dynamic_cast|cast interpreted as a "
-  "reinterpret_cast|cast from %1}0 is not allowed in a constant expression">;
+  "%select{reinterpret_cast|dynamic_cast|cast which performs the conversions of"
+  " a reinterpret_cast|cast from %1}0 is not allowed in a constant expression">;
 
 // inline asm related.
 let CategoryName = "Inline Assembly Issue" in {

Modified: cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp?rev=146406&r1=146405&r2=146406&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp Mon Dec 12 13:33:27 2011
@@ -307,16 +307,16 @@
     expected-note {{reinterpret_cast is not allowed in a constant expression}}
   int c : (S*)(long)(sptr) == (S*)(long)(sptr); // \
     expected-warning {{not integer constant expression}} \
-    expected-note {{cast interpreted as a reinterpret_cast is not allowed in a constant expression}}
+    expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int d : (S*)(42) == (S*)(42); // \
     expected-warning {{not integer constant expression}} \
-    expected-note {{cast interpreted as a reinterpret_cast is not allowed in a constant expression}}
+    expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int e : (Str*)(sptr) == (Str*)(sptr); // \
     expected-warning {{not integer constant expression}} \
-    expected-note {{cast interpreted as a reinterpret_cast is not allowed in a constant expression}}
+    expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int f : &(Str&)(*sptr) == &(Str&)(*sptr); // \
     expected-warning {{not integer constant expression}} \
-    expected-note {{cast interpreted as a reinterpret_cast is not allowed in a constant expression}}
+    expected-note {{cast which performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
   int g : (S*)(void*)(sptr) == sptr; // \
     expected-warning {{not integer constant expression}} \
     expected-note {{cast from 'void *' is not allowed in a constant expression}}





More information about the cfe-commits mailing list