diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-20 22:56:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-20 22:56:25 +0000 |
commit | 7c9e1b206cf638c52f79705f3cd557546dc262cc (patch) | |
tree | 23fdfc2d9a514383d350caee68f3534694b58dba /test/SemaTemplate | |
parent | d194f2aeb2ae7ac5e7e5c7b41638e042665b0d05 (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 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/temp_arg_nontype_cxx1z.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp b/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp index c1fcedd58d..d0fb25c047 100644 --- a/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp +++ b/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp @@ -23,6 +23,9 @@ namespace Array { A<const char*, &(&x)[1]> h; // expected-error {{refers to subobject '&x + 1'}} A<const char*, 0> i; // expected-error {{not allowed in a converted constant}} A<const char*, nullptr> j; + + extern char aub[]; + A<char[], aub> k; } namespace Function { |