diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp2a')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/char8_t1.C | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/char8_t2.C | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C | 8 |
3 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/char8_t1.C b/gcc/testsuite/g++.dg/cpp2a/char8_t1.C new file mode 100644 index 00000000000..aa0860b9f63 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/char8_t1.C @@ -0,0 +1,5 @@ +// P0482R6 +// { dg-do compile } +// { dg-options "-std=c++2a" } + +char8_t c8; diff --git a/gcc/testsuite/g++.dg/cpp2a/char8_t2.C b/gcc/testsuite/g++.dg/cpp2a/char8_t2.C new file mode 100644 index 00000000000..71eea7952d3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/char8_t2.C @@ -0,0 +1,5 @@ +// P0482R6 +// { dg-do compile } +// { dg-options "-std=c++2a -fno-char8_t" } + +char8_t c8; // { dg-error "does not name a type" } diff --git a/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C b/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C index b80cc342364..8e1ea48bb1d 100644 --- a/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C +++ b/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C @@ -471,3 +471,11 @@ #else # error "__has_cpp_attribute" #endif + +// C++2A features: + +#ifndef __cpp_char8_t +# error "__cpp_char8_t" +#elif __cpp_char8_t != 201811 +# error "__cpp_char8_t != 201811" +#endif |