aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/init.cc2
-rw-r--r--libcpp/lex.cc10
-rw-r--r--libcpp/macro.cc2
3 files changed, 10 insertions, 4 deletions
diff --git a/libcpp/init.cc b/libcpp/init.cc
index 5f34e35..ea683f0 100644
--- a/libcpp/init.cc
+++ b/libcpp/init.cc
@@ -114,7 +114,7 @@ static const struct lang_flags lang_defaults[] =
/* STDC99 */ { 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* STDC11 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* STDC17 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1 },
+ /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1 },
/* GNUCXX */ { 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1 },
/* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1 },
/* GNUCXX11 */ { 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1 },
diff --git a/libcpp/lex.cc b/libcpp/lex.cc
index b110792..9a21a3e 100644
--- a/libcpp/lex.cc
+++ b/libcpp/lex.cc
@@ -2135,8 +2135,14 @@ maybe_va_opt_error (cpp_reader *pfile)
/* __VA_OPT__ should not be accepted at all, but allow it in
system headers. */
if (!_cpp_in_system_header (pfile))
- cpp_error (pfile, CPP_DL_PEDWARN,
- "__VA_OPT__ is not available until C++20");
+ {
+ if (CPP_OPTION (pfile, cplusplus))
+ cpp_error (pfile, CPP_DL_PEDWARN,
+ "__VA_OPT__ is not available until C++20");
+ else
+ cpp_error (pfile, CPP_DL_PEDWARN,
+ "__VA_OPT__ is not available until C2X");
+ }
}
else if (!pfile->state.va_args_ok)
{
diff --git a/libcpp/macro.cc b/libcpp/macro.cc
index 7d5a0d0..452e14a 100644
--- a/libcpp/macro.cc
+++ b/libcpp/macro.cc
@@ -1093,7 +1093,7 @@ _cpp_arguments_ok (cpp_reader *pfile, cpp_macro *macro, const cpp_hashnode *node
if (argc < macro->paramc)
{
- /* In C++20 (here the va_opt flag is used), and also as a GNU
+ /* In C++20 and C2X (here the va_opt flag is used), and also as a GNU
extension, variadic arguments are allowed to not appear in
the invocation at all.
e.g. #define debug(format, args...) something