diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-21 06:58:08 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-21 06:58:08 +0000 |
| commit | d5f23b0b7528b5c3caed1ba14f897cc4aaa9e3c3 (patch) | |
| tree | 133ab22e59f61162b7f8e8e794dd6458769e8e1a /test/SemaTemplate/overloaded-functions.cpp | |
| parent | 624e91b063cecc3671eeb40e4b0fa08d71b59284 (diff) | |
Notes
Diffstat (limited to 'test/SemaTemplate/overloaded-functions.cpp')
| -rw-r--r-- | test/SemaTemplate/overloaded-functions.cpp | 32 |
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 0000000000000..26565753dd735 --- /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}} +} + |
