aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/default-expr-arguments.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-16 18:34:49 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-16 18:34:49 +0000
commite95b40961302c2130968ddfc3ba162e138f2118e (patch)
treeae9af375b0a6cb7bf1a16b555508307537f8fda4 /test/SemaTemplate/default-expr-arguments.cpp
parent59a53fa3f8ea73bae52ea36d0038f76e9f10729c (diff)
Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls even
when we are not instantiating the corresponding "current instantiation." This happens, e.g., when we are instantiating a declaration reference that refers into the "current instantiation" but occurs in a default function argument. The libstdc++ vector default constructor now instantiates properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r--test/SemaTemplate/default-expr-arguments.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp
index 01d0e60887..74d87e9db9 100644
--- a/test/SemaTemplate/default-expr-arguments.cpp
+++ b/test/SemaTemplate/default-expr-arguments.cpp
@@ -68,3 +68,13 @@ void test_x0_not_default_constructible(X0<NotDefaultConstructible> xn) {
xn.f(42);
xn.f(); // expected-note{{in instantiation of default function argument}}
}
+
+template<typename T>
+struct X1 {
+ typedef T value_type;
+ X1(const value_type& value = value_type());
+};
+
+void test_X1() {
+ X1<int> x1;
+}