summaryrefslogtreecommitdiff
path: root/test/FixIt/fixit-vexing-parse.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:11:37 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:11:37 +0000
commit461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch)
tree6942083d7d56bba40ec790a453ca58ad3baf6832 /test/FixIt/fixit-vexing-parse.cpp
parent75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff)
Notes
Diffstat (limited to 'test/FixIt/fixit-vexing-parse.cpp')
-rw-r--r--test/FixIt/fixit-vexing-parse.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/FixIt/fixit-vexing-parse.cpp b/test/FixIt/fixit-vexing-parse.cpp
index 71d3eff5329ad..973c6961a0879 100644
--- a/test/FixIt/fixit-vexing-parse.cpp
+++ b/test/FixIt/fixit-vexing-parse.cpp
@@ -106,3 +106,24 @@ namespace N {
wchar_t wc(); // expected-warning {{function declaration}} expected-note {{replace parentheses with an initializer}}
}
}
+
+namespace RedundantParens {
+struct Y {
+ Y();
+ Y(int);
+ ~Y();
+};
+int n;
+
+void test() {
+ // CHECK: add a variable name
+ // CHECK: fix-it:"{{.*}}":{[[@LINE+7]]:4-[[@LINE+7]]:4}:" varname"
+ // CHECK: add enclosing parentheses
+ // CHECK: fix-it:"{{.*}}":{[[@LINE+5]]:3-[[@LINE+5]]:3}:"("
+ // CHECK: fix-it:"{{.*}}":{[[@LINE+4]]:7-[[@LINE+4]]:7}:")"
+ // CHECK: remove parentheses
+ // CHECK: fix-it:"{{.*}}":{[[@LINE+2]]:4-[[@LINE+2]]:5}:" "
+ // CHECK: fix-it:"{{.*}}":{[[@LINE+1]]:6-[[@LINE+1]]:7}:""
+ Y(n); // expected-warning {{declaration of variable named 'n'}} expected-note 3{{}}
+}
+}