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/lib | |
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/lib')
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index b45d31c6b1e..63a4963946e 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -3165,7 +3165,12 @@ static void warnAboutRedundantParens(Sema &S, Declarator &D, QualType T) { // In a new-type-id, function chunks require parentheses. if (D.getContext() == Declarator::CXXNewContext) return; - LLVM_FALLTHROUGH; + // FIXME: "A(f())" deserves a vexing-parse warning, not just a + // redundant-parens warning, but we don't know whether the function + // chunk was syntactically valid as an expression here. + CouldBeTemporaryObject = false; + continue; + case DeclaratorChunk::BlockPointer: case DeclaratorChunk::MemberPointer: case DeclaratorChunk::Pipe: |