summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/instantiate-expr-4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-4.cpp')
-rw-r--r--test/SemaTemplate/instantiate-expr-4.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp
index 92915c7..8cd7342 100644
--- a/test/SemaTemplate/instantiate-expr-4.cpp
+++ b/test/SemaTemplate/instantiate-expr-4.cpp
@@ -43,6 +43,19 @@ struct Temporaries0 {
template struct Temporaries0<5, 7>;
+// Ensure that both the constructor and the destructor are instantiated by
+// checking for parse errors from each.
+template<int N> struct BadX {
+ BadX() { int a[-N]; } // expected-error {{array size is negative}}
+ ~BadX() { int a[-N]; } // expected-error {{array size is negative}}
+};
+
+template<int N>
+struct PR6671 {
+ void f() { (void)BadX<1>(); } // expected-note 2 {{instantiation}}
+};
+template struct PR6671<1>;
+
// ---------------------------------------------------------------------
// new/delete expressions
// ---------------------------------------------------------------------
OpenPOWER on IntegriCloud