From bdea08b2287fd48a654c5c7cd4f0b5efa74e0cd2 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 10 Sep 2014 17:03:37 +0000 Subject: [PATCH] Add a test for an operator access decl. In Parser::ParseCXXClassMemberDeclaration(), it was possible to change isAccessDecl = NextToken().is(tok::kw_operator); to isAccessDecl = false; and no tests would fail. Now there's coverage for this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217519 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/deprecated.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/SemaCXX/deprecated.cpp b/test/SemaCXX/deprecated.cpp index 2fe6d59861..5fcf2130d3 100644 --- a/test/SemaCXX/deprecated.cpp +++ b/test/SemaCXX/deprecated.cpp @@ -35,13 +35,19 @@ void stuff() { #endif } -struct S { int n; }; +struct S { int n; void operator+(int); }; struct T : private S { S::n; #if __cplusplus < 201103L // expected-warning@-2 {{access declarations are deprecated; use using declarations instead}} #else // expected-error@-4 {{ISO C++11 does not allow access declarations; use using declarations instead}} +#endif + S::operator+; +#if __cplusplus < 201103L + // expected-warning@-2 {{access declarations are deprecated; use using declarations instead}} +#else + // expected-error@-4 {{ISO C++11 does not allow access declarations; use using declarations instead}} #endif }; -- 2.40.0