summaryrefslogtreecommitdiff
path: root/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp')
-rw-r--r--clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp
new file mode 100644
index 0000000..885d11b
--- /dev/null
+++ b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// PR5787
+class C {
+ public:
+ ~C() {}
+};
+
+template <typename T>
+class E {
+ public:
+ E& Foo(const C&);
+ E& Bar() { return Foo(C()); }
+};
+
+void Test() {
+ E<int> e;
+ e.Bar();
+}