summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/instantiate-decl-init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/instantiate-decl-init.cpp')
-rw-r--r--test/SemaTemplate/instantiate-decl-init.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-decl-init.cpp b/test/SemaTemplate/instantiate-decl-init.cpp
new file mode 100644
index 0000000..d957f2d
--- /dev/null
+++ b/test/SemaTemplate/instantiate-decl-init.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// PR5426 - the non-dependent obj would be fully processed and wrapped in a
+// CXXConstructExpr at definition time, which would lead to a failure at
+// instantiation time.
+struct arg {
+ arg();
+};
+
+struct oldstylemove {
+ oldstylemove(oldstylemove&);
+ oldstylemove(const arg&);
+};
+
+template <typename T>
+void fn(T t, const arg& arg) {
+ oldstylemove obj(arg);
+}
+
+void test() {
+ fn(1, arg());
+}
OpenPOWER on IntegriCloud