summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/delete-and-function-templates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/delete-and-function-templates.cpp')
-rw-r--r--clang/test/SemaCXX/delete-and-function-templates.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/delete-and-function-templates.cpp b/clang/test/SemaCXX/delete-and-function-templates.cpp
index 418aa80e2fd..22e95cb7937 100644
--- a/clang/test/SemaCXX/delete-and-function-templates.cpp
+++ b/clang/test/SemaCXX/delete-and-function-templates.cpp
@@ -112,4 +112,22 @@ void foo() {
} // end ns3
+
+namespace ns4 {
+template < typename T> T* foo (T);
+template <> int* foo(int) = delete;
+template <> int* foo(int); //expected-note{{candidate}}
+
+int *IP = foo(2); //expected-error{{deleted}}
+double *DP = foo(3.14);
+} //end ns4
+
+namespace ns5 {
+template < typename T> T* foo (T);
+template <> int* foo(int); //expected-note{{previous}}
+template <> int* foo(int) = delete; //expected-error{{deleted definition must be first declaration}}
+
+} //end ns5
+
+
} // end test_explicit_specializations_and_delete
OpenPOWER on IntegriCloud