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

2009-03-10 Thread Jonathan Wakely
2009/3/10 Sylvain Pion: > Manuel López-Ibáñez wrote: >> 2009/3/10 Sylvain Pion: >>> >>> Yes, but like any extension, it's nice to be able to disable them >>> as errors, so as to be able to use GCC for checking code portability. >> >> So use -pedantic-errors as it says in the manual. You should real

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

2009-03-10 Thread Jason Merrill
-pedantic-errors will make it an error. I don't feel strongly about whether these should be pedwarn or something stronger, but I note that libstdc++ wants to use variadic templates in the default mode, so we can't just disable them entirely. Jason

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

2009-03-10 Thread Gabriel Dos Reis
On Tue, Mar 10, 2009 at 7:57 AM, Manuel López-Ibáñez wrote: > 2009/3/10 Sylvain Pion : >>> >>> But then probably, variadic templates are implemented as a GCC >>> extension to C++98 and they work fine with -std=c++98 despite what the >>> warning says. Or don't they? >> >> Yes, but like any extensio

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

2009-03-10 Thread Sylvain Pion
Gabriel Dos Reis wrote: On Tue, Mar 10, 2009 at 6:58 AM, Sylvain Pion wrote: Manuel López-Ibáñez wrote: 2009/3/10 Sylvain Pion : 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 t

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

2009-03-10 Thread Sylvain Pion
Manuel López-Ibáñez wrote: 2009/3/10 Sylvain Pion : But then probably, variadic templates are implemented as a GCC extension to C++98 and they work fine with -std=c++98 despite what the warning says. Or don't they? Yes, but like any extension, it's nice to be able to disable them as errors, so

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

2009-03-10 Thread Manuel López-Ibáñez
2009/3/10 Sylvain Pion : >> >> But then probably, variadic templates are implemented as a GCC >> extension to C++98 and they work fine with -std=c++98 despite what the >> warning says. Or don't they? > > Yes, but like any extension, it's nice to be able to disable them > as errors, so as to be able

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

2009-03-10 Thread Gabriel Dos Reis
On Tue, Mar 10, 2009 at 6:58 AM, Sylvain Pion wrote: > Manuel López-Ibáñez wrote: >> >> 2009/3/10 Sylvain Pion : >>> >>> 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 "s

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

2009-03-10 Thread Sylvain Pion
Manuel López-Ibáñez wrote: 2009/3/10 Sylvain Pion : 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. But then probably, variadic temp

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

2009-03-10 Thread Manuel López-Ibáñez
2009/3/10 Sylvain Pion : > > 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. > But then probably, variadic templates are implemented

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

2009-03-10 Thread Paolo Carlini
Sylvain Pion wrote: > 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. It is, you are right. Paolo.

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

2009-03-10 Thread Sylvain Pion
Jan van Dijk wrote: Consider the one-liner C++ 'program': template 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

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

2009-03-10 Thread Paolo Carlini
Manuel López-Ibáñez wrote: > In any case the wording of the warning is weird: it says variadic > templates are not available but then it is accepted with just a > warning. > I agree. >> to variadic templates. It also happens, for example, for: >> >> enum class e { }; >> >> > > What is the w

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

2009-03-10 Thread Manuel López-Ibáñez
2009/3/10 Paolo Carlini : >> >> warning: variadic templates only available with -std=c++0x or -std=gnu++0x >> > I'm afraid the behavior you are seeing is by design, and is not specific In any case the wording of the warning is weird: it says variadic templates are not available but then it is acce

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

2009-03-10 Thread Paolo Carlini
Hi, > Consider the one-liner C++ 'program': > > template 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 i

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

2009-03-10 Thread Jan van Dijk
Consider the one-liner C++ 'program': template 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 n