diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-21 22:26:47 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-21 22:26:47 +0000 |
| commit | e9d8789de35a13a75d4161ab81f05a26038801c5 (patch) | |
| tree | a01c93409d0baae16aa8108bbc9109e0b74e9ff4 /clang/test/Parser/cxx-decl.cpp | |
| parent | b9a18fd0a2a659b9d03bdbe03bc3cba8db5c5e27 (diff) | |
| download | bcm5719-llvm-e9d8789de35a13a75d4161ab81f05a26038801c5.tar.gz bcm5719-llvm-e9d8789de35a13a75d4161ab81f05a26038801c5.zip | |
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
Diffstat (limited to 'clang/test/Parser/cxx-decl.cpp')
| -rw-r--r-- | clang/test/Parser/cxx-decl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp index 711a874f6a2..58ad08079c1 100644 --- a/clang/test/Parser/cxx-decl.cpp +++ b/clang/test/Parser/cxx-decl.cpp @@ -282,6 +282,22 @@ namespace NNS { } } +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}} |

