summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/overloaded-functions.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-21 06:58:08 +0000
committerdim <dim@FreeBSD.org>2015-05-21 06:58:08 +0000
commit38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (patch)
tree133ab22e59f61162b7f8e8e794dd6458769e8e1a /test/SemaTemplate/overloaded-functions.cpp
parentc1ee82b9c3720cafd4ddba67d76e76d4edd03163 (diff)
downloadFreeBSD-src-38d6f2e7f2ce51a5b3836d26596c6c34a3288752.zip
FreeBSD-src-38d6f2e7f2ce51a5b3836d26596c6c34a3288752.tar.gz
Vendor import of clang RELEASE_361/final tag r237755 (effectively, 3.6.1 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_361/final@237755
Diffstat (limited to 'test/SemaTemplate/overloaded-functions.cpp')
-rw-r--r--test/SemaTemplate/overloaded-functions.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/SemaTemplate/overloaded-functions.cpp b/test/SemaTemplate/overloaded-functions.cpp
new file mode 100644
index 0000000..2656575
--- /dev/null
+++ b/test/SemaTemplate/overloaded-functions.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+namespace {
+template <bool, typename>
+void Foo() {}
+
+template <int size>
+void Foo() {
+ int arr[size];
+ // expected-error@-1 {{'arr' declared as an array with a negative size}}
+}
+}
+
+void test_foo() {
+ Foo<-1>();
+ // expected-note@-1 {{in instantiation of function template specialization '(anonymous namespace)::Foo<-1>' requested here}}
+}
+
+template <bool, typename>
+void Bar() {}
+
+template <int size>
+void Bar() {
+ int arr[size];
+ // expected-error@-1 {{'arr' declared as an array with a negative size}}
+}
+
+void test_bar() {
+ Bar<-1>();
+ // expected-note@-1 {{in instantiation of function template specialization 'Bar<-1>' requested here}}
+}
+
OpenPOWER on IntegriCloud