diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-02-11 00:19:33 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-02-11 00:19:33 +0000 |
| commit | 3a7796bccc3682d1d206d62f367ec409cdfd21f5 (patch) | |
| tree | e72469db2dd718c320fbfb8729bfc1e2406644a9 /clang/test/SemaTemplate/temp_param.cpp | |
| parent | c8dcf4d72bec6eb1b0402941fe4e865eb7c39f83 (diff) | |
| download | bcm5719-llvm-3a7796bccc3682d1d206d62f367ec409cdfd21f5.tar.gz bcm5719-llvm-3a7796bccc3682d1d206d62f367ec409cdfd21f5.zip | |
Add partial semantic checking of template arguments that are meant for
non-type template parameters of pointer-to-object and
pointer-to-function type. The most fun part of this is the use of
overload resolution to pick a function from the set of overloaded
functions that comes in as a template argument.
Also, fixed two minor bugs in this area:
- We were allowing non-type template parameters of type pointer to
void.
- We weren't patching up an expression that refers to an overloaded
function set via "&f" properly.
We're still not performing complete checking of the expression to be
sure that it is referring to an object or function with external
linkage (C++ [temp.arg.nontype]p1).
llvm-svn: 64266
Diffstat (limited to 'clang/test/SemaTemplate/temp_param.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/temp_param.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/temp_param.cpp b/clang/test/SemaTemplate/temp_param.cpp index e45d45629a5..1f10cc49c10 100644 --- a/clang/test/SemaTemplate/temp_param.cpp +++ b/clang/test/SemaTemplate/temp_param.cpp @@ -18,6 +18,7 @@ template<typename T, T x> struct A10; template<float f> struct A11; // expected-error{{a non-type template parameter cannot have type 'float'}} +template<void *Ptr> struct A12; // expected-error{{a non-type template parameter cannot have type 'void *'}} // C++ [temp.param]p8 template<int X[10]> struct A5; |

