diff options
author | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
commit | a926878ddbd5a98b272c22171ce58663fc04c3e0 (patch) | |
tree | 86af256e5d9a9c06263c00adc90e5fe348008c43 /libcpp/macro.c | |
parent | 542730f087133690b47e036dfd43eb0db8a650ce (diff) | |
parent | 07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff) | |
download | gcc-devel/autopar_devel.zip gcc-devel/autopar_devel.tar.gz gcc-devel/autopar_devel.tar.bz2 |
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'libcpp/macro.c')
-rw-r--r-- | libcpp/macro.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libcpp/macro.c b/libcpp/macro.c index 2573f31..2c7d732 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -1035,7 +1035,7 @@ _cpp_arguments_ok (cpp_reader *pfile, cpp_macro *macro, const cpp_hashnode *node if (argc < macro->paramc) { - /* In C++2a (here the va_opt flag is used), and also as a GNU + /* In C++20 (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 @@ -1258,11 +1258,13 @@ collect_args (cpp_reader *pfile, const cpp_hashnode *node, if (token->type == CPP_EOF) { - /* We still need the CPP_EOF to end directives, and to end - pre-expansion of a macro argument. Step back is not - unconditional, since we don't want to return a CPP_EOF to our - callers at the end of an -include-d file. */ - if (pfile->context->prev || pfile->state.in_directive) + /* We still need the CPP_EOF to end directives, to end + pre-expansion of a macro argument, and at the end of the main + file. We do not want it at the end of a -include'd (forced) + header file. */ + if (pfile->state.in_directive + || !pfile->line_table->depth + || pfile->context->prev) _cpp_backup_tokens (pfile, 1); cpp_error (pfile, CPP_DL_ERROR, "unterminated argument list invoking macro \"%s\"", @@ -2870,8 +2872,7 @@ cpp_get_token_1 (cpp_reader *pfile, location_t *location) || (peek_tok->flags & PREV_WHITE)); node = pfile->cb.macro_to_expand (pfile, result); if (node) - ret = enter_macro_context (pfile, node, result, - virt_loc); + ret = enter_macro_context (pfile, node, result, virt_loc); else if (whitespace_after) { /* If macro_to_expand hook returned NULL and it @@ -2888,8 +2889,7 @@ cpp_get_token_1 (cpp_reader *pfile, location_t *location) } } else - ret = enter_macro_context (pfile, node, result, - virt_loc); + ret = enter_macro_context (pfile, node, result, virt_loc); if (ret) { if (pfile->state.in_directive || ret == 2) |