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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64266 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/temp_param.cpp b/test/SemaTemplate/temp_param.cpp
index e45d456..1f10cc4 100644
--- a/test/SemaTemplate/temp_param.cpp
+++ b/test/SemaTemplate/temp_param.cpp
@@ -18,6 +18,7 @@
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;