summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-12-21 22:26:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-12-21 22:26:47 +0000
commite9d8789de35a13a75d4161ab81f05a26038801c5 (patch)
treea01c93409d0baae16aa8108bbc9109e0b74e9ff4 /clang/test/SemaCXX
parentb9a18fd0a2a659b9d03bdbe03bc3cba8db5c5e27 (diff)
downloadbcm5719-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/SemaCXX')
-rw-r--r--clang/test/SemaCXX/decl-expr-ambiguity.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/decl-expr-ambiguity.cpp b/clang/test/SemaCXX/decl-expr-ambiguity.cpp
index 1e31d701d0c..b77e226b5d0 100644
--- a/clang/test/SemaCXX/decl-expr-ambiguity.cpp
+++ b/clang/test/SemaCXX/decl-expr-ambiguity.cpp
@@ -125,3 +125,20 @@ void fizbin() {
baz b3; // expected-error {{must use 'class' tag to refer to type 'baz' in this scope}}
}
}
+
+namespace TemporaryFromFunctionCall {
+ struct A {
+ A(int);
+ };
+ int f();
+ int g(int);
+ namespace N {
+ void x() {
+ // FIXME: For the first and second of these (but not the third), we
+ // should produce a vexing-parse warning.
+ A(f());
+ A(g(int()));
+ A(g(int));
+ }
+ }
+}
OpenPOWER on IntegriCloud