summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticASTKinds.td
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-10-20 22:56:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-10-20 22:56:25 +0000
commit7c9e1b206cf638c52f79705f3cd557546dc262cc (patch)
tree23fdfc2d9a514383d350caee68f3534694b58dba /include/clang/Basic/DiagnosticASTKinds.td
parentd194f2aeb2ae7ac5e7e5c7b41638e042665b0d05 (diff)
Implement current CWG direction for support of arrays of unknown bounds in
constant expressions. We permit array-to-pointer decay on such arrays, but disallow pointer arithmetic (since we do not know whether it will have defined behavior). This is based on r311970 and r301822 (the former by me and the latter by Robert Haberlach). Between then and now, two things have changed: we have committee feedback indicating that this is indeed the right direction, and the code broken by this change has been fixed. This is necessary in C++17 to continue accepting certain forms of non-type template argument involving arrays of unknown bound. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticASTKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticASTKinds.td9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td
index b3cba2066e..215580b2e9 100644
--- a/include/clang/Basic/DiagnosticASTKinds.td
+++ b/include/clang/Basic/DiagnosticASTKinds.td
@@ -127,6 +127,10 @@ def note_constexpr_access_null : Note<
def note_constexpr_access_past_end : Note<
"%select{read of|assignment to|increment of|decrement of}0 "
"dereferenced one-past-the-end pointer is not allowed in a constant expression">;
+def note_constexpr_access_unsized_array : Note<
+ "%select{read of|assignment to|increment of|decrement of}0 "
+ "pointer to element of array without known bound "
+ "is not allowed in a constant expression">;
def note_constexpr_access_inactive_union_member : Note<
"%select{read of|assignment to|increment of|decrement of}0 "
"member %1 of union with %select{active member %3|no active member}2 "
@@ -154,6 +158,11 @@ def note_constexpr_baa_insufficient_alignment : Note<
def note_constexpr_baa_value_insufficient_alignment : Note<
"value of the aligned pointer (%0) is not a multiple of the asserted %1 "
"%plural{1:byte|:bytes}1">;
+def note_constexpr_unsupported_unsized_array : Note<
+ "array-to-pointer decay of array member without known bound is not supported">;
+def note_constexpr_unsized_array_indexed : Note<
+ "indexing of array without known bound is not allowed "
+ "in a constant expression">;
def warn_integer_constant_overflow : Warning<
"overflow in expression; result is %0 with type %1">,