diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-30 22:13:43 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-30 22:13:43 +0000 |
| commit | e4899c16480dfb06a0265274d0b5b0fe3b370b8a (patch) | |
| tree | 580366c742dff5d37cd53a967a33b0e9aeaa7562 /clang/test | |
| parent | e86329777563a372881a3952b2f73dc90becec6e (diff) | |
| download | bcm5719-llvm-e4899c16480dfb06a0265274d0b5b0fe3b370b8a.tar.gz bcm5719-llvm-e4899c16480dfb06a0265274d0b5b0fe3b370b8a.zip | |
PR37631: verify that a member deduction guide has the same access as its template.
llvm-svn: 333599
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp b/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp index 90f168d3fcc..de61e44a6e9 100644 --- a/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp +++ b/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp @@ -330,6 +330,22 @@ namespace member_guides { Bar(int) -> Bar<int>; }; Foo<int>::Bar b = 0; + + struct A { + template<typename T> struct Public; // expected-note {{declared public}} + Public(float) -> Public<float>; + protected: // expected-note {{declared protected by intervening access specifier}} + template<typename T> struct Protected; // expected-note 2{{declared protected}} + Protected(float) -> Protected<float>; + Public(int) -> Public<int>; // expected-error {{different access}} + private: // expected-note {{declared private by intervening access specifier}} + template<typename T> struct Private; // expected-note {{declared private}} + Protected(int) -> Protected<int>; // expected-error {{different access}} + public: // expected-note 2{{declared public by intervening access specifier}} + template<typename T> Public(T) -> Public<T>; + template<typename T> Protected(T) -> Protected<T>; // expected-error {{different access}} + template<typename T> Private(T) -> Private<T>; // expected-error {{different access}} + }; } #else |

