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: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2004 13:25:18 -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 bangerth at dealii dot org 2004-09-10 13:25 -------
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...
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391