]> granicus.if.org Git - clang/commitdiff
Add a test for an operator access decl.
authorNico Weber <nicolasweber@gmx.de>
Wed, 10 Sep 2014 17:03:37 +0000 (17:03 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 10 Sep 2014 17:03:37 +0000 (17:03 +0000)
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

index 2fe6d59861ac5c06149352c9172d02a7c97b2d45..5fcf2130d36f0a056554d714c624d17c03308912 100644 (file)
@@ -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
 };