diff options
Diffstat (limited to 'test/SemaTemplate/temp_arg_nontype_cxx1z.cpp')
-rw-r--r-- | test/SemaTemplate/temp_arg_nontype_cxx1z.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp b/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp index c1fcedd58d13..1a84d545c647 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 { @@ -235,6 +238,10 @@ namespace Auto { constexpr char s[] = "test"; template<const auto* p> struct S { }; S<s> p; + + template<typename R, typename P, R F(P)> struct A {}; + template<typename R, typename P, R F(P)> void x(A<R, P, F> a); + void g(int) { x(A<void, int, &g>()); } } namespace DecltypeAuto { |