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]

Re: bug report...


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



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