aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/addr-of-overloaded-function.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-22 18:44:12 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-22 18:44:12 +0000
commite9ee23edd17c4bb7f271e67f8790792b4de677fc (patch)
tree4588b8e20cf8033c3ba36ddd453cc3b2f0a308d6 /test/SemaCXX/addr-of-overloaded-function.cpp
parentfe1ea7b3e4552a612a1b0a11734598651e5ddfdf (diff)
Use the naming class from the overloaded lookup when access-checking an
address of overloaded function, instead of assuming that a nested name specifier was used. A nested name specifier is not required for static functions. Fixes PR6886. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/addr-of-overloaded-function.cpp')
-rw-r--r--test/SemaCXX/addr-of-overloaded-function.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/addr-of-overloaded-function.cpp b/test/SemaCXX/addr-of-overloaded-function.cpp
index 391fc30959..f8b00df173 100644
--- a/test/SemaCXX/addr-of-overloaded-function.cpp
+++ b/test/SemaCXX/addr-of-overloaded-function.cpp
@@ -70,3 +70,19 @@ struct C {
int (&fp)() = f; // expected-error{{address of overloaded function 'f' does not match required type 'int ()'}}
}
};
+
+// PR6886
+namespace test0 {
+ void myFunction(void (*)(void *));
+
+ class Foo {
+ void foo();
+
+ static void bar(void*);
+ static void bar();
+ };
+
+ void Foo::foo() {
+ myFunction(bar);
+ }
+}