diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-30 17:20:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-30 17:20:14 +0000 |
commit | b33fe2ff12676bff9db595fdf77e29014d7ba397 (patch) | |
tree | deba668430364d13f17ccb4dc34fdd650560eaa0 /test | |
parent | 5f6c19419184da428ad8982c1a5d706dbf4896ed (diff) |
When recursively instantiating function templates, keep track of the
instantiation stack so that we provide a full instantiation
backtrace. Previously, we performed all of the instantiations implied
by the recursion, but each looked like a "top-level" instantiation.
The included test case tests the previous fix for the instantiation of
DeclRefExprs. Note that the "instantiated from" diagnostics still
don't tell us which template arguments we're instantiating with.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/basic/basic.def.odr/p2-typeid.cpp | 2 | ||||
-rw-r--r-- | test/SemaTemplate/recursive-template-instantiation.cpp | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/test/CXX/basic/basic.def.odr/p2-typeid.cpp b/test/CXX/basic/basic.def.odr/p2-typeid.cpp index 7eb10ef52e..881212d74b 100644 --- a/test/CXX/basic/basic.def.odr/p2-typeid.cpp +++ b/test/CXX/basic/basic.def.odr/p2-typeid.cpp @@ -32,5 +32,5 @@ void test(X<Poly> xp, X<Poly, Poly&> xpr, X<NonPoly> xnp, X<NonPoly, NonPoly&> x xnpr.g(NonPoly()); // Triggers an error (as it should); - xpr.g(Poly()); + xpr.g(Poly()); // expected-note{{instantiation of member function}} } diff --git a/test/SemaTemplate/recursive-template-instantiation.cpp b/test/SemaTemplate/recursive-template-instantiation.cpp new file mode 100644 index 0000000000..7c88d5019f --- /dev/null +++ b/test/SemaTemplate/recursive-template-instantiation.cpp @@ -0,0 +1,10 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +template<typename T> void f(T* t) { + f(*t); // expected-error{{no matching function}}\ + // expected-note 3{{requested here}} +} + +void test_f(int ****p) { + f(p); // expected-note{{requested here}} +} |