diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-19 00:54:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-19 00:54:10 +0000 |
commit | 53e535161dfa9850de394b300915fc250eb0fdf4 (patch) | |
tree | f67b990a98af93dcddbe29d12ee8ef45a573579a /test/SemaCXX/cxx98-compat.cpp | |
parent | b9c8c42c392d0fe7079b968bbd5ed2bd4bd2f8d2 (diff) |
Add a -Wc++98-compat warning for friend functions of class templates which would
be implicitly instantiated (resulting in a redefinition) in C++98.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx98-compat.cpp')
-rw-r--r-- | test/SemaCXX/cxx98-compat.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp index 8da54f0da6..193a418d7f 100644 --- a/test/SemaCXX/cxx98-compat.cpp +++ b/test/SemaCXX/cxx98-compat.cpp @@ -179,3 +179,10 @@ template<typename T> typename T::ImPrivate SFINAEAccessControl(T t) { // expecte } int SFINAEAccessControl(...) { return 0; } int CheckSFINAEAccessControl = SFINAEAccessControl(PrivateMember()); + +template<typename T> +struct FriendRedefinition { + friend void Friend() {} // expected-warning {{friend function 'Friend' would be implicitly redefined in C++98}} expected-note {{previous}} +}; +FriendRedefinition<int> FriendRedef1; +FriendRedefinition<char> FriendRedef2; // expected-note {{requested here}} |