This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: variadic templates supported in non-c++0x mode


Jan van Dijk wrote:
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.)

Should I file a bug report?

The problem I fear is that variadic templates are already conveniently used as an implementation detail in libstdc++. And the warning there is probably hidden by the "system header" warning removal machinery.

I have already been bitten by this : I have a configuration test program
that passes (with a warning), while an error would be expected in non-C++0x
mode, so the rest of the code uses it, which triggers lots of warning.
My workaround for this is to test for G++0x mode explicitly in addition,
and #error on it in my test program.

--
Sylvain Pion
INRIA Sophia-Antipolis
Geometrica Project-Team
CGAL, http://cgal.org/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]