C++ PATCH: PR 20599 (1/3)

Doug Gregor doug.gregor@gmail.com
Thu Sep 14 13:16:00 GMT 2006


On 9/14/06, Richard Guenther <richard.guenther@gmail.com> wrote:
> I think to get this into the 4.3 release (which will probably happen
> before C++-0x happens) you need to add a standards variant that
> is default-off, so the 0x features can be enabled by something like
> -std=c++-0x

I flip-flopped a couple of times before I decided on the behavior in
the patch. Variadic templates are a pure extension (no changed
behavior, no new keywords), so if you don't use them, they do no harm.
Also, even if the user doesn't want to allow variadic templates, we
might still decide to use them in our implementation of TR1.

So, I decided to make variadic templates always available. When
-pedantic or -Wvariadic-templates is supplied, we'll warn (or error,
if -pedantic-errors) that it's not ISO C++. This warning is suppressed
in system headers, so we can use it in our TR1 implementation. Of
course, -Wno-variadic-templates suppresses the warning even if
-pedantic is specified.

I imagine that -std=c++0x would just turn off this warning, and enable
other non-pure C++0x extensions (e.g., static_assert, which needs a
new keyword).

> Also it would be nice to have this (and patches for rvalue references
> and concepts) on a branch together with possibly pending library
> work to give people an easier way to play with the new features.

This would be very nice. I've skimmed the rvalue references patch, but
can't say at the moment whether it's ready. The concepts patch is
still in its early stages of development, and I fear that it would do
more harm than good to have it on a C++0x-specific branch. We continue
to maintain the concepts patch (a.k.a. ConceptGCC) in a separate (but
publically accessible) Subversion repository at:

  http://www.generic-programming.org/software/ConceptGCC/

  Cheers,
  Doug



More information about the Gcc-patches mailing list