diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-06-25 21:55:30 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-06-25 21:55:30 +0000 |
commit | d9cf8268dcd3f4d393b7a38fef7eb40c7e7f4d10 (patch) | |
tree | 28955259c8c4703cfe67104483d6627fca163ad2 /test/SemaCXX/deleted-function.cpp | |
parent | c9f351700721150a985f21844fbfec55b04e861d (diff) |
PR12937: Explicitly deleting an explicit template specialization.
This works around a quirk in the way that explicit template specializations are
handled in Clang. We generate an implicit declaration from the original
template which the explicit specialization is considered to redeclare. This
trips up the explicit delete logic.
This change only works around that strange representation. At some point it'd
be nice to remove those extra declarations to make the AST more accurately
reflect the C++ semantics.
Review by Doug Gregor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/deleted-function.cpp')
-rw-r--r-- | test/SemaCXX/deleted-function.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/deleted-function.cpp b/test/SemaCXX/deleted-function.cpp index d13fd0eb7b..2ee6064501 100644 --- a/test/SemaCXX/deleted-function.cpp +++ b/test/SemaCXX/deleted-function.cpp @@ -55,3 +55,11 @@ struct Z : virtual DelDtor { ~Z() {} // expected-error {{attempt to use a deleted function}} }; DelDtor dd; // expected-error {{attempt to use a deleted function}} + +template<typename> void test2() = delete; +template void test2<int>(); + +// test3 really shouldn't have behavior that differs from test2 above +template<typename> void test3() = delete; // expected-note {{explicit instantiation refers here}} +template<typename> void test3(); +template void test3<int>(); // expected-error {{explicit instantiation of undefined function template 'test3'}} |