diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-12 08:16:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-12 08:16:09 +0000 |
commit | bdd7b2358b764526f65881e832915b62a975bc0a (patch) | |
tree | 76476d017a186defcb1c9e4c35354e94c6c6acd7 /clang/test/SemaCXX/addr-of-overloaded-function.cpp | |
parent | d5b730c9d522e7ac55e8227d6bf109c13faca504 (diff) | |
download | bcm5719-llvm-bdd7b2358b764526f65881e832915b62a975bc0a.tar.gz bcm5719-llvm-bdd7b2358b764526f65881e832915b62a975bc0a.zip |
Don't assert when attempting to take the address of an overloaded
function fails due to ambiguities in partial ordering of function
templates. Fixes PR8033.
llvm-svn: 113725
Diffstat (limited to 'clang/test/SemaCXX/addr-of-overloaded-function.cpp')
-rw-r--r-- | clang/test/SemaCXX/addr-of-overloaded-function.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/addr-of-overloaded-function.cpp b/clang/test/SemaCXX/addr-of-overloaded-function.cpp index b581b8a3f64..46bdf8e6b65 100644 --- a/clang/test/SemaCXX/addr-of-overloaded-function.cpp +++ b/clang/test/SemaCXX/addr-of-overloaded-function.cpp @@ -96,3 +96,11 @@ namespace PR7971 { static bool g(int, char); }; } + +namespace PR8033 { + template <typename T1, typename T2> int f(T1 *, const T2 *); // expected-note{{candidate function [with T1 = const int, T2 = int]}} + template <typename T1, typename T2> int f(const T1 *, T2 *); // expected-note{{candidate function [with T1 = int, T2 = const int]}} + int (*p)(const int *, const int *) = f; // expected-error{{address of overloaded function 'f' is ambiguous}} \ + // expected-error{{cannot initialize a variable of type}} + +} |