This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27560] template function not recognized when invoked with enum defined in function
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2006 16:24:07 -0000
- Subject: [Bug c++/27560] template function not recognized when invoked with enum defined in function
- References: <bug-27560-1313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from gdr at integrable-solutions dot net 2006-05-11 16:24 -------
Subject: Re: New: template function not recognized when invoked with enum
defined in function
"ian at airs dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| 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.
There is a core issue for this. We discussed it again at the last
meeting in Berlin. There are proposals to make it "just work", but
that is still in the open state.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27560