This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
- 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: 10 Sep 2004 13:43:58 -0000
- Subject: [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
- References: <20040910113653.17391.zak@transversal.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-09-10 13:43 -------
Subject: Re: [3.3 regression] template parameter accepted on typedef name
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| By the way, if someone wonders what the compiler is actually doing
| here: for this code
| -------------------
| template<typename> struct foo { foo();};
|
| int main() {
| typedef foo<int> bar;
| bar<double> baz;
| }
| -------------------
| we get these symbols:
| g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ -c x.cc
| g/x> nm -C x.o
| U __gxx_personality_v0
| 00000000 T main
| U foo<double>::foo()
|
| So, lo and behold, the compiler uses the spurious "double" template
| argument, rather than the "int" passed to the typedef. Very interesting...
Ouch!
This might be related to our failure to enforce "kind" of names before
use or declarations.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391