2014-12-23 01:56:50 +08:00
|
|
|
// RUN: %clang_cc1 -DSTDCPP11 -std=c++11 -verify -fsyntax-only %s
|
|
|
|
// RUN: %clang_cc1 -DSTDGNU11 -std=gnu++11 -verify -fsyntax-only %s
|
2014-12-24 06:32:37 +08:00
|
|
|
// RUN: %clang_cc1 -DSTDGNU11TRI -ftrigraphs -std=gnu++11 -verify -fsyntax-only %s
|
2014-12-23 01:56:50 +08:00
|
|
|
// RUN: %clang_cc1 -DSTDCPP17 -std=c++1z -verify -fsyntax-only %s
|
2014-12-24 06:32:37 +08:00
|
|
|
// RUN: %clang_cc1 -DSTDCPP17TRI -ftrigraphs -std=c++1z -verify -fsyntax-only %s
|
2014-12-23 02:35:03 +08:00
|
|
|
// RUN: %clang_cc1 -DMSCOMPAT -fms-compatibility -std=c++11 -verify -fsyntax-only %s
|
2020-08-14 02:33:04 +08:00
|
|
|
// RUN: %clang_cc1 -DNOTRI -fno-trigraphs -verify -fsyntax-only %s
|
2014-12-23 01:56:50 +08:00
|
|
|
|
|
|
|
void foo() {
|
2014-12-23 02:35:03 +08:00
|
|
|
#if defined(NOFLAGS) || defined(STDCPP11) || defined(STDGNU11TRI) || \
|
2020-08-14 02:33:04 +08:00
|
|
|
defined(STDCPP17TRI) || (defined(__MVS__) && !defined(NOTRI))
|
2014-12-23 01:56:50 +08:00
|
|
|
const char c[] = "??/n"; // expected-warning{{trigraph converted to '\' character}}
|
2020-08-14 02:33:04 +08:00
|
|
|
#elif defined(STDGNU11) || defined(STDCPP17) || defined(MSCOMPAT) || \
|
|
|
|
defined(NOTRI)
|
2014-12-23 01:56:50 +08:00
|
|
|
const char c[] = "??/n"; // expected-warning{{trigraph ignored}}
|
|
|
|
#else
|
|
|
|
#error Not handled.
|
|
|
|
#endif
|
|
|
|
}
|