On 12/31/19 6:05 AM, Jakub Jelinek wrote:
Hi!My PR90677 fix actually made building older GCCs with newer ones worse. The problem is that identifier_global_value used earlier returned either the type decl on success or NULL_TREE on failure and the caller in that case just defers handling it until later, and that is also what the C identifier_global_tag implementation does, but C++ uses lookup_qualified_name which returns error_mark_node if not found, rather than NULL_TREE and the c-format.c caller is unprepared to handle that and diagnoses error. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, additionally tested by building GCC 8 with unmodified trunk (failed with In file included from ./config.h:8, from ../../gcc/gimple-streamer-in.c:22: ../../gcc/../include/ansidecl.h:169:64: error: ‘cgraph_node’ is not defined as a type 169 | # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) | ^ ... ) and finally building GCC 8 with patched trunk, which succeeded. Ok for trunk/9.3? 2019-12-31 Jakub Jelinek <[email protected]> PR c/90677 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name has not been found, rather than error_mark_node.
ok. I vaguely recall consciously making this change in behaviour, on the basis that if we were looking for a global binding, it would be an error for the lookup to fail (either by finding nothing, or because the user made it ambiguous in some way). But I didn't know about the kind of speculative lookup you have here.
nathan -- Nathan Sidwell
