aboutsummaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r--test/SemaCXX/destructor.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp
index fe1dde5771ac..49cdc50f3c13 100644
--- a/test/SemaCXX/destructor.cpp
+++ b/test/SemaCXX/destructor.cpp
@@ -431,3 +431,23 @@ class Invalid {
// The constructor definition should not have errors
Invalid::~Invalid() {}
+
+namespace PR30361 {
+template <typename T>
+struct C1 {
+ ~C1() {}
+ operator C1<T>* () { return nullptr; }
+ void foo1();
+};
+
+template<typename T>
+void C1<T>::foo1() {
+ C1::operator C1<T>*();
+ C1::~C1();
+}
+
+void foo1() {
+ C1<int> x;
+ x.foo1();
+}
+}