diff options
author | Tom Stellard <tstellar@redhat.com> | 2018-10-26 17:32:52 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2018-10-26 17:32:52 +0000 |
commit | 778fb86de1c851b8670bfb689de37368f2243edc (patch) | |
tree | 7185e4e9ee59308a3ad069bf4a70c65f8ae0b0a4 /test | |
parent | 8699d8d8f9aa9959a6c1acd506b04996e3c1bd12 (diff) |
Merging r341775:
------------------------------------------------------------------------
r341775 | rsmith | 2018-09-09 22:32:13 -0700 (Sun, 09 Sep 2018) | 2 lines
Part of PR33222: defer enforcing return type mismatch for dependent
friend function declarations of class templates.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_70@345409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-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}} +} |