C++ Logo

SG7

Advanced search

Subject: Re: Reason for members of namespace
From: David Vandevoorde (daveed_at_[hidden])
Date: 2020-11-04 09:56:04


> On Nov 4, 2020, at 9:25 AM, Andrew Sutton via SG7 <sg7_at_[hidden]> wrote:
[...]
> Back in the day I thought about a "is_first_redeclaration" predicate, I don't know if somebody else considered something like this, compilers probably maintain a pointer to previous declarations in redeclared AST Nodes, so it is probably cheap acquire this info, and even if you get out-of-order function declarations in different compilations units you still can get the same function name and parameter types, even in cases when parameter names are different;
>
> That's not implementable in GCC without major surgery because it merges declarations. There is no first and last declaration, only the most recently seen. I don't believe it's the only compiler that works this way.

Right. EDG mostly doesn't (by default) record declarations per se at all. Instead, we keep track of a "composite entity" resulting from all the declarations seen so far.

        Daveed



SG7 list run by sg7-owner@lists.isocpp.org

Older Archives on Google Groups