summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-24 05:54:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-24 05:54:19 +0000
commit16a74704c9e7cebcdba819befa5dfab75fab9259 (patch)
tree977aca7f29826127668034ee01376e54db984e6f /clang/test
parentb7d8563973fe5970509d526c73697feb1081c4c2 (diff)
downloadbcm5719-llvm-16a74704c9e7cebcdba819befa5dfab75fab9259.tar.gz
bcm5719-llvm-16a74704c9e7cebcdba819befa5dfab75fab9259.zip
[AST] Perform additional canonicalization for DependentSizedArrayType
We treated DependentSizedArrayTypes with the same element type but differing size expressions as equivalently canonical. This would lead to bizarre behavior during template instantiation. This fixes PR24212. llvm-svn: 243093
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/alias-template.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/alias-template.cpp b/clang/test/SemaCXX/alias-template.cpp
index d5eb27a6613..bcfe428c69d 100644
--- a/clang/test/SemaCXX/alias-template.cpp
+++ b/clang/test/SemaCXX/alias-template.cpp
@@ -168,3 +168,14 @@ namespace SFINAE {
fail1<int> f1; // expected-note {{here}}
fail2<E> f2; // expected-note {{here}}
}
+
+namespace PR24212 {
+struct X {};
+template <int I>
+struct S {
+ template <int J>
+ using T = X[J];
+ using U = T<I>;
+};
+static_assert(__is_same(S<3>::U, X[2]), ""); // expected-error {{static_assert failed}}
+}
OpenPOWER on IntegriCloud