diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-29 21:14:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-29 21:14:36 +0000 |
commit | 4ed49f375d6faee8c11a1324f1b6df845f12566e (patch) | |
tree | 6f00d7e7b9076f141953494d00e0edca3b659214 /clang/test | |
parent | db2732ac42a367ecf61614c8344cc39ed250c17d (diff) | |
download | bcm5719-llvm-4ed49f375d6faee8c11a1324f1b6df845f12566e.tar.gz bcm5719-llvm-4ed49f375d6faee8c11a1324f1b6df845f12566e.zip |
When performing template argument deduction of a function template
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.
llvm-svn: 115086
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/addr-of-overloaded-function.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/addr-of-overloaded-function.cpp b/clang/test/SemaCXX/addr-of-overloaded-function.cpp index 46bdf8e6b65..ab80d8f1416 100644 --- a/clang/test/SemaCXX/addr-of-overloaded-function.cpp +++ b/clang/test/SemaCXX/addr-of-overloaded-function.cpp @@ -104,3 +104,15 @@ namespace PR8033 { // expected-error{{cannot initialize a variable of type}} } + +namespace PR8196 { + template <typename T> struct mcdata { + typedef int result_type; + }; + template <class T> + typename mcdata<T>::result_type wrap_mean(mcdata<T> const&); + void add_property(double(*)(mcdata<double> const &)); // expected-note{{candidate function not viable: no overload of 'wrap_mean' matching}} + void f() { + add_property(&wrap_mean); // expected-error{{no matching function for call to 'add_property'}} + } +} |