diff options
Diffstat (limited to 'test/SemaCXX/friend.cpp')
-rw-r--r-- | test/SemaCXX/friend.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/friend.cpp b/test/SemaCXX/friend.cpp index 1f64ba609b..61e96922f6 100644 --- a/test/SemaCXX/friend.cpp +++ b/test/SemaCXX/friend.cpp @@ -388,3 +388,26 @@ namespace default_arg { friend void f(void *p = 0) {} // expected-error {{must be the only}} }; } + +namespace PR33222 { + int f(); + template<typename T> struct X { + friend T f(); + }; + X<int> xi; + + int g(); // expected-note {{previous}} + template<typename T> struct Y { + friend T g(); // expected-error {{return type}} + }; + Y<float> yf; // expected-note {{instantiation}} + + int h(); + template<typename T> struct Z { + // FIXME: The note here should point at the non-friend declaration, not the + // instantiation in Z<int>. + friend T h(); // expected-error {{return type}} expected-note {{previous}} + }; + Z<int> zi; + Z<float> zf; // expected-note {{instantiation}} +} |