r217519 - Add a test for an operator access decl.

Nico Weber nicolasweber at gmx.de
Wed Sep 10 10:03:37 PDT 2014


Author: nico
Date: Wed Sep 10 12:03:37 2014
New Revision: 217519

URL: http://llvm.org/viewvc/llvm-project?rev=217519&view=rev
Log:
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.

Modified:
    cfe/trunk/test/SemaCXX/deprecated.cpp

Modified: cfe/trunk/test/SemaCXX/deprecated.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/deprecated.cpp?rev=217519&r1=217518&r2=217519&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/deprecated.cpp (original)
+++ cfe/trunk/test/SemaCXX/deprecated.cpp Wed Sep 10 12:03:37 2014
@@ -35,12 +35,18 @@ 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 at -2 {{access declarations are deprecated; use using declarations instead}}
 #else
+  // expected-error at -4 {{ISO C++11 does not allow access declarations; use using declarations instead}}
+#endif
+  S::operator+;
+#if __cplusplus < 201103L
+  // expected-warning at -2 {{access declarations are deprecated; use using declarations instead}}
+#else
   // expected-error at -4 {{ISO C++11 does not allow access declarations; use using declarations instead}}
 #endif
 };





More information about the cfe-commits mailing list