diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-16 19:09:40 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-16 19:09:40 +0000 |
commit | 124b878dba5007df0a268ea128a6ad8dc5dd2c5e (patch) | |
tree | 0205137be98d7019dfafe6f0858e6f43fb00314d /test/SemaTemplate/destructor-template.cpp | |
parent | 8d2ea4ea7b28ee4eed97182bf7866ef918d20813 (diff) | |
download | clang-124b878dba5007df0a268ea128a6ad8dc5dd2c5e.tar.gz |
Improve parsing and instantiation of destructor names, so that we can
now cope with the destruction of types named as dependent templates,
e.g.,
y->template Y<T>::~Y()
Nominally, we implement C++0x [basic.lookup.qual]p6. However, we don't
follow the letter of the standard here because that would fail to
parse
template<typename T, typename U>
X0<T, U>::~X0() { }
properly. The problem is captured in core issue 339, which gives some
(but not enough!) guidance. I expect to revisit this code when the
resolution of 339 is clear, and/or we start capturing better source
information for DeclarationNames.
Fixes PR6152.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/destructor-template.cpp')
-rw-r--r-- | test/SemaTemplate/destructor-template.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/destructor-template.cpp b/test/SemaTemplate/destructor-template.cpp index b5ad967d69..7dd429b796 100644 --- a/test/SemaTemplate/destructor-template.cpp +++ b/test/SemaTemplate/destructor-template.cpp @@ -17,3 +17,16 @@ void destroy_me(T me) { } template void destroy_me(Incomplete*); + +namespace PR6152 { + template<typename T> struct X { void f(); }; + template<typename T> struct Y { }; + template<typename T> + void X<T>::f() { + Y<T> *y; + y->template Y<T>::~Y(); + } + + template struct X<int>; +} + |