clang/test/Parser/compound_literal.c
raw| 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -verify -x c++ -Wno-dangling-assignment %s |
| 3 | // expected-no-diagnostics |
| 4 | int main(void) { |
| 5 | char *s; |
| 6 | // In C++ mode, the cast creates a "char [4]" array temporary here. |
| 7 | s = (char []){"whatever"}; // dangling! |
| 8 | s = (char(*)){s}; |
| 9 | } |