summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-09-10 17:03:37 +0000
committerNico Weber <nicolasweber@gmx.de>2014-09-10 17:03:37 +0000
commitafecff50ac92f281c7c7369d9dd9701f13e16b02 (patch)
tree8a22eaf84a85514be6ad725bc90ea3016c07173f
parent0dbcfba659421014916a818847e63c3b74631d54 (diff)
downloadbcm5719-llvm-afecff50ac92f281c7c7369d9dd9701f13e16b02.tar.gz
bcm5719-llvm-afecff50ac92f281c7c7369d9dd9701f13e16b02.zip
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. llvm-svn: 217519
-rw-r--r--clang/test/SemaCXX/deprecated.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/deprecated.cpp b/clang/test/SemaCXX/deprecated.cpp
index 2fe6d59861a..5fcf2130d36 100644
--- a/clang/test/SemaCXX/deprecated.cpp
+++ b/clang/test/SemaCXX/deprecated.cpp
@@ -35,7 +35,7 @@ void stuff() {
#endif
}
-struct S { int n; };
+struct S { int n; void operator+(int); };
struct T : private S {
S::n;
#if __cplusplus < 201103L
@@ -43,6 +43,12 @@ struct T : private S {
#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
};
#if __cplusplus >= 201103L
OpenPOWER on IntegriCloud