This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: variadic templates supported in non-c++0x mode
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jan van Dijk <jan at epgmod dot phys dot tue dot nl>
- Cc: gcc at gcc dot gnu dot org, Jason Merrill <jason at redhat dot com>
- Date: Tue, 10 Mar 2009 12:18:48 +0100
- Subject: Re: variadic templates supported in non-c++0x mode
- References: <200903101156.16887.jan@epgmod.phys.tue.nl>
Hi,
> Consider the one-liner C++ 'program':
>
> template <class... args> struct pack;
>
> With the trunk, g++ -c [-std=gnu++98] gives:
>
> warning: variadic templates only available with -std=c++0x or -std=gnu++0x
>
> Should this not be an *error* instead? Variadic templates really should not be
> supported in non-c++0x mode.
>
> If not, how can I explicitly disable support for variadic templates? (The
> present behaviour frustrates some of our local autoconf tests.)
>
I'm afraid the behavior you are seeing is by design, and is not specific
to variadic templates. It also happens, for example, for:
enum class e { };
But I agree it may cause problems. Before filing a PR, let's ask Jason,
maybe he is willing to review for us the rationale...
Paolo.