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 | de63d36fb2101573f03e5104a0511a378e2473ac (patch) | |
tree | 1305bb5e666126168fe63ccd78a41dd203508ee8 /clang/test/SemaTemplate/dependent-sized_array.cpp | |
parent | 069a2df6fd0fa2b545116df27b9d2b3adb3e8464 (diff) | |
download | bcm5719-llvm-de63d36fb2101573f03e5104a0511a378e2473ac.tar.gz bcm5719-llvm-de63d36fb2101573f03e5104a0511a378e2473ac.zip |
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!
llvm-svn: 167642
Diffstat (limited to 'clang/test/SemaTemplate/dependent-sized_array.cpp')
-rw-r--r-- | clang/test/SemaTemplate/dependent-sized_array.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-sized_array.cpp b/clang/test/SemaTemplate/dependent-sized_array.cpp index cf0e0f37ee0..6fdcaa63e5a 100644 --- a/clang/test/SemaTemplate/dependent-sized_array.cpp +++ b/clang/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 }}; + } +} |