From 73d3618223f2081eedcee2dbc4b6f89c4e942214 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 12 Oct 2010 07:14:40 +0000 Subject: C's comma operator performs lvalue conversion on both its operands; require them to have complete types. llvm-svn: 116297 --- clang/test/Sema/exprs.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test/Sema/exprs.c') diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c index 56a52bed1bc..d6e17ff6ecc 100644 --- a/clang/test/Sema/exprs.c +++ b/clang/test/Sema/exprs.c @@ -150,3 +150,10 @@ int test20(int x) { // no warning, this is an idiom for "true" in old C style. return x && (signed char)1; } + +struct Test21; // expected-note 2 {{forward declaration}} +void test21(volatile struct Test21 *ptr) { + void test21_help(void); + (test21_help(), *ptr); // expected-error {{incomplete type 'struct Test21' where a complete type is required}} + (*ptr, test21_help()); // expected-error {{incomplete type 'struct Test21' where a complete type is required}} +} -- cgit v1.2.3