From c72c57c9e9b69944e3e009cd5e209634839581d3 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- test/SemaCXX/address-of.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'test/SemaCXX/address-of.cpp') diff --git a/test/SemaCXX/address-of.cpp b/test/SemaCXX/address-of.cpp index 69fcaff..373e44c 100644 --- a/test/SemaCXX/address-of.cpp +++ b/test/SemaCXX/address-of.cpp @@ -22,12 +22,12 @@ enum E { }; void test() { - (void)&Enumerator; // expected-error{{address expression must be an lvalue or a function designator}} + (void)&Enumerator; // expected-error{{cannot take the address of an rvalue of type 'E'}} } template void test2() { - (void)&N; // expected-error{{address expression must be an lvalue or a function designator}} + (void)&N; // expected-error{{cannot take the address of an rvalue of type 'int'}} } // PR clang/3222 @@ -41,6 +41,14 @@ struct PR11066 { }; void PR11066::test() { - int (PR11066::*ptr)(int) = & &PR11066::foo; // expected-error{{address expression must be an lvalue or a function designator}} + int (PR11066::*ptr)(int) = & &PR11066::foo; // expected-error{{extra '&' taking address of overloaded function}} } +namespace test3 { + // emit no error + template struct S { + virtual void f() = 0; + }; + template void S::f() { T::error; } + void (S::*p)() = &S::f; +} -- cgit v1.1