summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_arg_nontype.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-11 00:44:29 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-11 00:44:29 +0000
commitf684e6e793a336f52138a2609b207e6eef3c3022 (patch)
treeca33ef2b3558012463767b1549393c38b063ac5c /test/SemaTemplate/temp_arg_nontype.cpp
parente6c4f65bd4f36b32c0f81662b232523fd6a732a3 (diff)
downloadclang-f684e6e793a336f52138a2609b207e6eef3c3022.tar.gz
clang-f684e6e793a336f52138a2609b207e6eef3c3022.tar.bz2
clang-f684e6e793a336f52138a2609b207e6eef3c3022.tar.xz
Semantic checking for template arguments that correspond to non-type
template parameters that have reference type. Effectively, we're doing a very limited form of reference binding here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_arg_nontype.cpp')
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index 4b1db5ad68..26ebb551e0 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -67,3 +67,15 @@ A3<g> *a14_7; // expected-error{{non-type template argument of type '<overloaded
// FIXME: expected-error{{expected unqualified-id}}
// FIXME: the first error includes the string <overloaded function
// type>, which makes Doug slightly unhappy.
+
+
+struct Y { } y;
+
+volatile X * X_volatile_ptr;
+template<X const &AnX> struct A4; // expected-note 2{{template parameter is declared here}}
+A4<*X_ptr> *a15_1; // okay
+A4<*X_volatile_ptr> *a15_2; // expected-error{{reference binding of non-type template parameter of type 'class X const &' to template argument of type 'class X volatile' ignores qualifiers}} \
+ // FIXME: expected-error{{expected unqualified-id}}
+A4<y> *15_3; // expected-error{{non-type template parameter of reference type 'class X const &' cannot bind to template argument of type 'struct Y'}}\
+ // FIXME: expected-error{{expected unqualified-id}}
+