diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-08 15:20:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-08 15:20:28 +0000 |
commit | 3afb97700200f629d6036e437267af9c1fd37c90 (patch) | |
tree | c49129ce83712b55084ed683a1c2b367dfbc100a /test/SemaCXX/addr-of-overloaded-function.cpp | |
parent | 94c8022573b2f7da5124558a8d0597b0e8fbb381 (diff) |
When attempting reference binding to an overloaded function, also
consider that we might be trying to bind a reference to a class type,
which involves a constructor call. Fixes PR7425.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/addr-of-overloaded-function.cpp')
-rw-r--r-- | test/SemaCXX/addr-of-overloaded-function.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/SemaCXX/addr-of-overloaded-function.cpp b/test/SemaCXX/addr-of-overloaded-function.cpp index c095e946c8..00d91043e4 100644 --- a/test/SemaCXX/addr-of-overloaded-function.cpp +++ b/test/SemaCXX/addr-of-overloaded-function.cpp @@ -116,3 +116,32 @@ namespace PR8196 { add_property(&wrap_mean); // expected-error{{no matching function for call to 'add_property'}} } } + +namespace PR7425 { + template<typename T> + void foo() + { + } + + struct B + { + template<typename T> + B(const T&) + { + } + }; + + void bar(const B& b) + { + } + + void bar2(const B& b = foo<int>) + { + } + + void test(int argc, char** argv) + { + bar(foo<int>); + bar2(); + } +} |