Jakub Jelinek 6e77a83ffb libcpp: Fix error recovery after use of __VA_ARGS__ as macro argument [PR118674]
The following testcase ICEs after emitting one pedwarn (about using
__VA_ARGS__ in a place where it shouldn't be used) and one error.
The error is emitted by _cpp_save_parameter where it sees the node
has been used already earlier.  But unlike the other _cpp_save_parameter
caller which does goto out; if it returns false, this call with explicit
__VA_ARGS__ doesn't and if it increments number of parameters etc. after
the error, we then try to unsave it twice.

The following patch fixes it by doing the goto out in that case too,
the macro will then not be considered as variable arguments macro,
but for error recovery I think that is fine.
The other option would be before the other _cpp_save_parameter caller
check if the node is pfile->spec_nodes.n__VA_ARGS__ and in that case
also error and goto out, but that seems more expensive than this for
the common case that the macro definition is correct.

2025-04-09  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/118674
	* macro.cc (parse_params) <case CPP_ELLIPSIS>: If _cpp_save_parameter
	failed for __VA_ARGS__, goto out.

	* gcc.dg/cpp/pr118674.c: New test.
2025-04-09 12:27:38 +02:00
2025-01-02 11:59:57 +01:00
2024-11-26 00:19:26 +00:00
2025-03-28 00:19:00 +00:00
2025-04-02 00:18:25 +00:00
2025-03-30 00:16:46 +00:00
2025-01-02 11:59:57 +01:00
2025-01-11 00:19:49 +00:00
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-04-09 00:18:02 +00:00
2025-04-06 00:17:12 +00:00
2025-03-29 00:17:59 +00:00
2025-04-09 00:18:02 +00:00
2025-04-01 00:19:09 +00:00
2025-03-30 00:16:46 +00:00
2025-01-03 00:17:15 +00:00
2025-01-02 11:59:57 +01:00
2025-04-09 00:18:02 +00:00
2025-04-08 00:17:33 +00:00
2025-01-07 00:18:08 +00:00
2025-01-02 11:59:57 +01:00
2025-04-09 00:18:02 +00:00
2025-01-02 11:59:57 +01:00
2025-03-07 00:17:19 +00:00
2025-04-08 00:17:33 +00:00
2025-04-03 00:18:15 +00:00
2025-03-31 23:35:29 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.7 GiB
Languages
C++ 30.7%
C 30.1%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.5%