On 10/31/19 1:17 PM, Jakub Jelinek wrote:
Hi!
Seems libcpp has been ICEing on push_macro of a builtin macro since 2010,
but it became more urgent with Martin's __has_builtin builtin macro
addition, because the mingw headers already do use
#pragma push_macro("__has_builtin")
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
ew, that;s unfortunate.
The following patch fixes it by handling builtin macros properly,
noting that they were builtin previously and when restoring them into
the builtin state from whatever other state changing them according to
the builtin_array.
ok, a nit:
+void
+_cpp_restore_special_builtin (cpp_reader *pfile, struct def_pragma_macro *c)
+{
+ const struct builtin_macro *b;
+ size_t len = strlen (c->name);
+
+ for (b = builtin_array; b < builtin_array + ARRAY_SIZE (builtin_array); b++)
could you write as ...?
for (const builtin_macro *b = ...
nathan
--
Nathan Sidwell