This is the mail archive of the
mailing list for the GCC project.
Re: PATCH c++/19628 (take 2)
- From: Roger Sayle <roger at eyesopen dot com>
- To: Matt Austern <matt at lafstern dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Jan 2005 11:22:39 -0700 (MST)
- Subject: Re: PATCH c++/19628 (take 2)
On Sun, 30 Jan 2005, Matt Austern wrote:
> There may be other builtins that we want to allow in constant
> expressions. If so, this patch will make it easy to add them
> as desired.
One distinction that may be useful in this respect, might be something
like builtin.c's CALLED_AS_BUILT_IN macro. This can be used to
distinguish built-in functions called as __builtin_foo from those
called as foo (or std::foo). By using this, the C++ front-end
maintainers could choose to allow __builtin_fabs(0.0) to be a
compile-time constant, whilst retaining the usual semantics of
fabs(0.0). __builtin_constant_p would then be just a special case.
This isn't a request for Matt to tweak this patch, which is best
left for the C++ front-end maintainers to review, just a suggestion
of a potential implementation of Matt's new builtin_is_constant_p.