public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27560]  New: template function not recognized when invoked with enum defined in function
@ 2006-05-11 15:43 ian at airs dot com
  2006-05-11 15:58 ` [Bug c++/27560] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ian at airs dot com @ 2006-05-11 15:43 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

Compiling this file, with mainline, gcc 4.0, or 4.1

template<typename t> void f(t a) { }
void g() { enum e { v }; f(v); }

gives this error message:

foo.cc: In function ‘void g()’:
foo.cc:2: error: no matching function for call to ‘f(g()::e)’

If the enum definition is moved out of the function, this works.  With gcc 3.2,
this works.  I didn't try 3.4.

My C++ fu is weak, and I do not know for sure that this is valid C++, although
I don't see anything wrong with it.  But either 1) it is valid and gcc should
accept it, or 2) gcc should provide a list of candidates which did not match,
since there is manifestly a function named 'f'.


-- 
           Summary: template function not recognized when invoked with enum
                    defined in function
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


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


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

end of thread, other threads:[~2009-11-04 20:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11 15:43 [Bug c++/27560] New: template function not recognized when invoked with enum defined in function ian at airs dot com
2006-05-11 15:58 ` [Bug c++/27560] " pinskia at gcc dot gnu dot org
2006-05-11 16:07 ` pinskia at gcc dot gnu dot org
2006-05-11 16:24 ` gdr at integrable-solutions dot net
2006-05-11 16:33 ` gdr at gcc dot gnu dot org
2006-05-11 16:38 ` pinskia at gcc dot gnu dot org
2006-05-11 16:48 ` gdr at integrable-solutions dot net
2006-05-11 22:56 ` ian at airs dot com
2006-05-11 23:03 ` pinskia at gcc dot gnu dot org
2006-05-11 23:20 ` gdr at integrable-solutions dot net
2009-11-04 20:16 ` jason at gcc dot gnu dot org

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).