10 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// RUN: %clang_cc1 -fsyntax-only -verify -x c++ -Wno-dangling-assignment %s3// expected-no-diagnostics4int 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}10