This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [c++] builtin functions and namespaces
- To: gcc at gcc dot gnu dot org
- Subject: Re: [c++] builtin functions and namespaces
- From: brent at rcfile dot org
- Date: Sat, 30 Sep 2000 02:49:22 -0400
- References: <200009261624.e8QGOtj19536@fillmore.constant.com> <20000926195501.A15158@rcfile.org> <200009271439.QAA29442@pandora.informatik.hu-berlin.de>
On 27 Sep 2000 at 16:39 (+0200), Martin von Loewis wrote:
| > gcc/cp/call.c: build_new_function_call()
| > which kicks the error because
| > gcc/cp/call.c: tourney()
| > returns 0 because
| > gcc/cp/call.c: joust()
| > returns 0 because joust can't decide whether to pick the
| > ::std::__builtin_fn or ::__buitlin_fn as the better candidate
ok, so far I see:
init_decl_processing()
c_common_nodes_and_builtins()
[the builtins in question are created here]
...
yyparse()
finish_call_expr()
build_x_function_call()
build_new_function_call()
[error emitted in here]
I tried to follow the (desired) function's declaration, but seem to
be stuck in bison.simple (or possibly just tired and impatient :)
...anyway, my thought it to stuff all of the builtins into an anon
namespace at creation time, so they don't appear in ::. this means
that foreach fn declaration, we'd have to traverse a list of builtins
to see if our declared fn name matches a builtin, pull the builtin
into the current_namespace.
is this a reasonable approach? I'm not quite sure (yet) where this'd
be done, but I'll dig for that tomorrow.
another option (still) _appears_ to be to check if the function decl
is _also_ a builtin decl at call time.
thoughts? advice?
question: (excuse my lack of knowledge, please)
given an existing function decl tree, how would I (re)classify
that tree node as having been defined in a namespace, when it
was originally _not_?
thanks.
brent
--
All opinions expressed are My own, unless otherwise attributed. In
presenting facts, I expressly reserve the right to be Wrong. Portions
of this message authored by Me are subject to the Free Thought License.