This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bug report...
- To: "B. James Phillippe" <bryan at terran dot org>
- Subject: Re: bug report...
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 06 Jun 1998 14:51:52 -0300
- Cc: egcs Mailing List <egcs at cygnus dot com>
- References: <Pine.LNX.3.96.980606003134.23023B-100000@earth.terran.org>
B James Phillippe <bryan@terran.org> writes:
> On 5 Jun 1998, Alexandre Oliva wrote:
>> using local classes as template arguments is *not* ANSI/ISO C++, it
>> is an extension provided by gcc and egcs.
> I'm sorry, I missed the first part of this thread. Can you provide a small
> snippet of code that illustrates this?
void foo() { struct s {}; vector<s> a; }
Since foo()::s (assuming this name were valid) has internal linkage,
it cannot be used as a template argument.
> is there a warning or compiler flag that prevents someone from
> inadvertently writing this non-portable code?
I don't think so. As Jason Merrill has written in another post, this
is an unintentional extension. I believe no one has ever coded any
test that prevents such usage.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil