public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39099]  New: Local classes cannot be used as template arguments
@ 2009-02-04 17:28 tohava at gmail dot com
  2009-02-05  0:46 ` [Bug c++/39099] " paolo dot carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: tohava at gmail dot com @ 2009-02-04 17:28 UTC (permalink / raw)
  To: gcc-bugs

I've tried defining a local class and then using it as a template argument,
this fails to work.

Here is a very short code example:
#include <iostream>

template <class T>
void func2785() {

}

class A {};

int main() {
        class B {} b;
        func2785<A>();
        func2785<B>();
}

This bug also in g++ 3.4.6.


-- 
           Summary: Local classes cannot be used as template arguments
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tohava at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39099


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/39099] Local classes cannot be used as template arguments
  2009-02-04 17:28 [Bug c++/39099] New: Local classes cannot be used as template arguments tohava at gmail dot com
@ 2009-02-05  0:46 ` paolo dot carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-02-05  0:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2009-02-05 00:46 -------
This is not a bug, but Standard conforming behaviour. The next C++ Standard
will be different here.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39099


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-05  0:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-04 17:28 [Bug c++/39099] New: Local classes cannot be used as template arguments tohava at gmail dot com
2009-02-05  0:46 ` [Bug c++/39099] " paolo dot carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).