From 3fe1e09a6e285a4792224969b582ada1bd6747f8 Mon Sep 17 00:00:00 2001 From: Nikola Smiljanic Date: Tue, 1 Jul 2014 04:17:53 +0000 Subject: PR15677 - Crash in template diffing. Check that expression is evaluatable before evaluating it. llvm-svn: 212090 --- clang/test/Misc/diag-template-diffing.cpp | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'clang/test/Misc/diag-template-diffing.cpp') diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp index 46807070c7c..c43ed263c69 100644 --- a/clang/test/Misc/diag-template-diffing.cpp +++ b/clang/test/Misc/diag-template-diffing.cpp @@ -1068,6 +1068,43 @@ void foo() { } } +namespace PR15677 { +template +struct A{}; + +template +using B = A; + +template +using B = A; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A' vs 'A') + +template +struct C{}; + +template +using D = C; + +template +using D = C; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('C' vs 'C') + +template +using E = C; + +template +using E = C<42>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('C<42>' vs 'C') + +template +using F = C; + +template +using F = C<21 + 21>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('C<21 + 21 aka 42>' vs 'C') +} +} + // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-ELIDE-TREE: {{[0-9]*}} errors generated. -- cgit v1.2.3