From 368055211a73667d8d452f3dcd1a157f89064a92 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 25 Jun 2012 21:55:30 +0000 Subject: 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. llvm-svn: 159167 --- clang/test/SemaCXX/deleted-function.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/SemaCXX/deleted-function.cpp') diff --git a/clang/test/SemaCXX/deleted-function.cpp b/clang/test/SemaCXX/deleted-function.cpp index d13fd0eb7b4..2ee60645019 100644 --- a/clang/test/SemaCXX/deleted-function.cpp +++ b/clang/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 void test2() = delete; +template void test2(); + +// test3 really shouldn't have behavior that differs from test2 above +template void test3() = delete; // expected-note {{explicit instantiation refers here}} +template void test3(); +template void test3(); // expected-error {{explicit instantiation of undefined function template 'test3'}} -- cgit v1.2.3