diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-19 00:07:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-19 00:07:01 +0000 |
commit | 77faa365cb2322cfc8edf58a4f5d68f2370cc39a (patch) | |
tree | 0037d28e1b6631f91ebc0d04430abae8c4c8feda /test/SemaCXX/cxx98-compat.cpp | |
parent | b224343723f514123dc7181ba9543ac361b35416 (diff) |
-Wc++98-compat: warn if a SFINAE substitution in C++11 suppresses an access
control diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx98-compat.cpp')
-rw-r--r-- | test/SemaCXX/cxx98-compat.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp index 84dc87ac3d..8da54f0da6 100644 --- a/test/SemaCXX/cxx98-compat.cpp +++ b/test/SemaCXX/cxx98-compat.cpp @@ -170,3 +170,12 @@ struct BadFriends { }; int n = {}; // expected-warning {{scalar initialized from empty initializer list is incompatible with C++98}} + +class PrivateMember { + struct ImPrivate {}; +}; +template<typename T> typename T::ImPrivate SFINAEAccessControl(T t) { // expected-warning {{substitution failure due to access control is incompatible with C++98}} expected-note {{while substituting deduced template arguments into function template 'SFINAEAccessControl' [with T = PrivateMember]}} + return typename T::ImPrivate(); +} +int SFINAEAccessControl(...) { return 0; } +int CheckSFINAEAccessControl = SFINAEAccessControl(PrivateMember()); |