diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-09 23:03:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-09 23:03:14 +0000 |
commit | a67d503aa19700ff849fc590039b6bb8ced4ebf0 (patch) | |
tree | 55f2b0309bec82bf1b496d6ed9153ec157309ffa /test/SemaTemplate/dependent-sized_array.cpp | |
parent | 6af1405ad2b30422bedee4dbe116fd693aeeeed8 (diff) |
PR13788: Don't perform checks on the initializer of a dependently-typed
variable. Previously we didn't notice the type was dependent if the only
dependence came from an array bound.
Patch by Brian Brooks!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/dependent-sized_array.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-sized_array.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-sized_array.cpp b/test/SemaTemplate/dependent-sized_array.cpp index cf0e0f37ee..6fdcaa63e5 100644 --- a/test/SemaTemplate/dependent-sized_array.cpp +++ b/test/SemaTemplate/dependent-sized_array.cpp @@ -15,3 +15,14 @@ void f1() { int a1[] = { 1, 2, 3, N }; int a3[sizeof(a1)/sizeof(int) != 4? 1 : -1]; // expected-error{{negative}} } + +namespace PR13788 { + template <unsigned __N> + struct S { + int V; + }; + template <int N> + void foo() { + S<0> arr[N] = {{ 4 }}; + } +} |