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 | bcd625305b2d97f1684ce6597e20959e9eb00879 (patch) | |
| tree | 5d24f3514268a874832b92b02b34775ed07f6710 /clang/test/SemaCXX | |
| parent | c5688628d89cdcffd9b901bebaa795e2ffddc11f (diff) | |
| download | bcm5719-llvm-bcd625305b2d97f1684ce6597e20959e9eb00879.tar.gz bcm5719-llvm-bcd625305b2d97f1684ce6597e20959e9eb00879.zip | |
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.
llvm-svn: 118407
Diffstat (limited to 'clang/test/SemaCXX')
| -rw-r--r-- | clang/test/SemaCXX/addr-of-overloaded-function.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/addr-of-overloaded-function.cpp b/clang/test/SemaCXX/addr-of-overloaded-function.cpp index c095e946c8b..00d91043e4e 100644 --- a/clang/test/SemaCXX/addr-of-overloaded-function.cpp +++ b/clang/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(); + } +} |

