Skip to content

Commit

Permalink
Further tweaking of diagnostic text for casts performing reinterpret_…
Browse files Browse the repository at this point in the history
…cast

conversions in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146406 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zygoloid committed Dec 12, 2011
1 parent 3b29bb9 commit 60f24e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/clang/Basic/DiagnosticASTKinds.td
Expand Up @@ -13,8 +13,8 @@ let Component = "AST" in {
// "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 {
Expand Down
8 changes: 4 additions & 4 deletions test/SemaCXX/constant-expression-cxx11.cpp
Expand Up @@ -307,16 +307,16 @@ struct Str {
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}}
Expand Down

0 comments on commit 60f24e7

Please sign in to comment.