This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC's statement expression extension
>>>>> "llewelly" == llewelly <llewelly@dbritsch.dsl.xmission.com> writes:
llewelly> However, as soon as I said that, I immediately thought
llewelly> of a g++ extension I do *not* want removed: allowing
llewelly> templates with default arguments to be used as template
llewelly> template parameters when the formal template template
llewelly> parameter has fewer arguments than the actual parameter,
llewelly> and the excess arguments of the actual all have
llewelly> defaults.
Interesting. I looked at that code recently, and couldn't decide if
the standard intended that, or not. It doesn't actually say. I sent
mail to a couple of people about what they thought the standard
intended, but nobody replied.
The problem is that there are no safe extensions in this area. If g++
accepts this code, and shouldn't, then I bet I can come up with an
overloading example where g++ gives an ambiguous overloading message
on valid code, where a conforming compiler wouldn't. Basically, you
can't allow any additional template instantiations without breaking
conforming code.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com