Skip to content

Commit d398fa1

Browse files
Add regression test
1 parent f85579f commit d398fa1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

clang/test/Sema/gh106576.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %clang_cc1 -fsyntax-only -verify %s
2+
3+
typedef _Atomic char atomic_char;
4+
5+
typedef _Atomic char atomic_char;
6+
7+
atomic_char counter;
8+
9+
char load_plus_one(void) {
10+
return ({counter;}) + 1; // no crash
11+
}
12+
13+
char type_of_stmt_expr(void) {
14+
typeof(({counter;})) y = ""; // expected-error-re {{incompatible pointer to integer conversion initializing 'typeof (({{{.*}}}))' (aka 'char') with an expression of type 'char[1]'}}
15+
return y;
16+
}

0 commit comments

Comments
 (0)