summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-08 15:20:28 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-08 15:20:28 +0000
commitbcd625305b2d97f1684ce6597e20959e9eb00879 (patch)
tree5d24f3514268a874832b92b02b34775ed07f6710 /clang/test/SemaCXX
parentc5688628d89cdcffd9b901bebaa795e2ffddc11f (diff)
downloadbcm5719-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.cpp29
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();
+ }
+}
OpenPOWER on IntegriCloud