]> granicus.if.org Git - clang/commit
Implement current CWG direction for support of arrays of unknown bounds in
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 20 Oct 2017 22:56:25 +0000 (22:56 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 20 Oct 2017 22:56:25 +0000 (22:56 +0000)
commit7c9e1b206cf638c52f79705f3cd557546dc262cc
tree23fdfc2d9a514383d350caee68f3534694b58dba
parentd194f2aeb2ae7ac5e7e5c7b41638e042665b0d05
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
include/clang/Basic/DiagnosticASTKinds.td
include/clang/Basic/DiagnosticIDs.h
lib/AST/ExprConstant.cpp
test/SemaCXX/constant-expression-cxx11.cpp
test/SemaCXX/constexpr-array-unknown-bound.cpp [new file with mode: 0644]
test/SemaTemplate/temp_arg_nontype_cxx1z.cpp