Suppress "redundant parens" warning for "A (::B())".
This is a slightly odd construct (it's more common to see "A (::B)()") but can
happen in friend declarations, and the parens are not redundant as they prevent
the :: binding to the left.
llvm-svn: 321318
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp
index 711a874..58ad0807 100644
--- a/clang/test/Parser/cxx-decl.cpp
+++ b/clang/test/Parser/cxx-decl.cpp
@@ -282,6 +282,22 @@
}
}
+inline namespace ParensAroundFriend { // expected-error 0-1{{C++11}}
+ struct A {};
+ struct B {
+ static A C();
+ };
+ namespace X {
+ struct B {};
+ struct D {
+ // No warning here: while this could be written as
+ // friend (::B::C)();
+ // we do need parentheses *somewhere* here.
+ friend A (::B::C());
+ };
+ }
+}
+
// PR8380
extern "" // expected-error {{unknown linkage language}}
test6a { ;// expected-error {{C++ requires a type specifier for all declarations}}