summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/expressions.c
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2013-10-08 16:56:30 +0000
committerSerge Pavlov <sepavloff@gmail.com>2013-10-08 16:56:30 +0000
commitaa57a64ef69c774a37420c79a8d3b50d559c3661 (patch)
tree6e7c53074974b57ce2300ddecc0cabdcb4352dc2 /clang/test/Parser/expressions.c
parent016be42362c6b9caa3fd0cbc218257a82bb43491 (diff)
downloadbcm5719-llvm-aa57a64ef69c774a37420c79a8d3b50d559c3661.tar.gz
bcm5719-llvm-aa57a64ef69c774a37420c79a8d3b50d559c3661.zip
Add fixits suggesting parenthesis around type name in expressions like sizeof.
This fixes PR16992 - Fixit missing when "sizeof type" found. llvm-svn: 192200
Diffstat (limited to 'clang/test/Parser/expressions.c')
-rw-r--r--clang/test/Parser/expressions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Parser/expressions.c b/clang/test/Parser/expressions.c
index 0d1b6c945c5..6c567f91baa 100644
--- a/clang/test/Parser/expressions.c
+++ b/clang/test/Parser/expressions.c
@@ -57,3 +57,13 @@ void test7() {
({} // expected-note {{to match}}
; // expected-error {{expected ')'}}
}
+
+// PR16992
+struct pr16992 { int x; };
+
+void func_16992 () {
+ int x1 = sizeof int; // expected-error{{missed parenthesis around the type name in sizeof}}
+ int x2 = sizeof struct pr16992; // expected-error{{missed parenthesis around the type name in sizeof}}
+ int x3 = __alignof int; // expected-error{{missed parenthesis around the type name in __alignof}}
+ int x4 = _Alignof int; // expected-error{{missed parenthesis around the type name in _Alignof}}
+}
OpenPOWER on IntegriCloud