diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-21 05:04:46 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-21 05:04:46 +0000 |
commit | 7098cbd601ad915aed22d4b5850da99359f25bf3 (patch) | |
tree | 6ec1a0099f3ae963cb6bfe16f90edb10c9a61668 /include/clang/Basic | |
parent | 9bddf4324a067b630c0f1147f283de0930092f5a (diff) |
constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticASTKinds.td | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td index 8f0b4938ad..d4e5693ff9 100644 --- a/include/clang/Basic/DiagnosticASTKinds.td +++ b/include/clang/Basic/DiagnosticASTKinds.td @@ -9,6 +9,7 @@ let Component = "AST" in { +// Constant expression diagnostics. These (and their users) belong in Sema. //def note_comma_in_ice : Note< // "C does not permit evaluated commas in an integer constant expression">; def note_expr_divide_by_zero : Note<"division by zero">; @@ -33,8 +34,26 @@ def note_constexpr_past_end : Note< def note_constexpr_var_init_non_constant : Note< "initializer of %0 is not a constant expression">; def note_constexpr_temporary_here : Note<"temporary created here">; +def note_constexpr_literal_here : Note<"literal written here">; def note_constexpr_depth_limit_exceeded : Note< "constexpr evaluation exceeded maximum depth of %0 calls">; +def note_constexpr_ltor_volatile_type : Note< + "read of volatile-qualified type %0 is not allowed in a constant expression">; +def note_constexpr_ltor_volatile_obj : Note< + "read of volatile %select{temporary|object %1|member %1}0 is not allowed in " + "a constant expression">; +def note_constexpr_ltor_non_const_int : Note< + "read of non-const variable %0 is not allowed in a constant expression">; +def note_constexpr_ltor_non_constexpr : Note< + "read of non-constexpr variable %0 is not allowed in a constant expression">; +def note_constexpr_read_past_end : Note< + "read of dereferenced one-past-the-end pointer is not allowed in a " + "constant expression">; +def note_constexpr_read_inactive_union_member : Note< + "read of member %0 of union with %select{active member %2|no active member}1 " + "is not allowed in a constant expression">; +def note_constexpr_read_uninit : Note< + "read of uninitialized object is not allowed in a constant expression">; def note_constexpr_calls_suppressed : Note< "(skipping %0 call%s0 in backtrace; use -fconstexpr-backtrace-limit=0 to " "see all)">; |