summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/deleted-function.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-06-25 21:55:30 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-06-25 21:55:30 +0000
commit368055211a73667d8d452f3dcd1a157f89064a92 (patch)
tree625568c9f5786a4cd0b4bf0f592fcefb8bc8355c /clang/test/SemaCXX/deleted-function.cpp
parent606953fbe76744eca6bc8c0c9e35ddcddaa1da29 (diff)
downloadbcm5719-llvm-368055211a73667d8d452f3dcd1a157f89064a92.tar.gz
bcm5719-llvm-368055211a73667d8d452f3dcd1a157f89064a92.zip
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
Diffstat (limited to 'clang/test/SemaCXX/deleted-function.cpp')
-rw-r--r--clang/test/SemaCXX/deleted-function.cpp8
1 files changed, 8 insertions, 0 deletions
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<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'}}
OpenPOWER on IntegriCloud