20 lines · cpp
1// RUN: %clang_cc1 -DSTDCPP11 -std=c++11 -verify -fsyntax-only %s2// RUN: %clang_cc1 -DSTDGNU11 -std=gnu++11 -verify -fsyntax-only %s3// RUN: %clang_cc1 -DSTDGNU11TRI -ftrigraphs -std=gnu++11 -verify -fsyntax-only %s4// RUN: %clang_cc1 -DSTDCPP17 -std=c++1z -verify -fsyntax-only %s5// RUN: %clang_cc1 -DSTDCPP17TRI -ftrigraphs -std=c++1z -verify -fsyntax-only %s6// RUN: %clang_cc1 -DMSCOMPAT -fms-compatibility -std=c++11 -verify -fsyntax-only %s7// RUN: %clang_cc1 -DNOTRI -fno-trigraphs -verify -fsyntax-only %s8 9void foo() {10#if defined(NOFLAGS) || defined(STDCPP11) || defined(STDGNU11TRI) || \11 defined(STDCPP17TRI) || (defined(__MVS__) && !defined(NOTRI))12 const char c[] = "??/n"; // expected-warning{{trigraph converted to '\' character}}13#elif defined(STDGNU11) || defined(STDCPP17) || defined(MSCOMPAT) || \14 defined(NOTRI)15 const char c[] = "??/n"; // expected-warning{{trigraph ignored}}16#else17#error Not handled.18#endif19}20