public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name
@ 2004-09-10 11:37 zak at transversal dot com
2004-09-10 11:38 ` [Bug c++/17391] " zak at transversal dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: zak at transversal dot com @ 2004-09-10 11:37 UTC (permalink / raw)
To: gcc-bugs
The following (invalid) code compiles in 3.3.1 through to 3.3.4 and current 3.3
branch CVS, and appears to construct a foo<double>. It produces the expected
error in the original 3.3 release and in 2.95.4, 3.0.4, 3.2.3 and 3.4.1.
It therefore appears to be a 3.3 branch regression introduced in 3.3.1.
// test case
template< typename T >
struct foo { };
int main(void)
{
typedef foo<int> bar;
bar<double> baz; // this line is invalid
}
--
Summary: [3.3 regression] template parameter accepted on typedef
name
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zak at transversal dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
@ 2004-09-10 11:38 ` zak at transversal dot com
2004-09-10 13:23 ` bangerth at dealii dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: zak at transversal dot com @ 2004-09-10 11:38 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Known to fail| |3.3.1 3.3.2 3.3.3 3.3.4
Known to work| |2.95.4 3.0.4 3.2.3 3.3 3.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
2004-09-10 11:38 ` [Bug c++/17391] " zak at transversal dot com
@ 2004-09-10 13:23 ` bangerth at dealii dot org
2004-09-10 13:25 ` bangerth at dealii dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-09-10 13:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-09-10 13:22 -------
Confirmed. I believe this is a duplicate of some other bug, but I don't
have the time right now to find that one.
Given that this is an accepts-invalid regression that doesn't do
much harm, this doesn't get a very high priority.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-09-10 13:22:59
date| |
Target Milestone|--- |3.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
2004-09-10 11:38 ` [Bug c++/17391] " zak at transversal dot com
2004-09-10 13:23 ` bangerth at dealii dot org
@ 2004-09-10 13:25 ` bangerth at dealii dot org
2004-09-10 13:43 ` gdr at integrable-solutions dot net
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-09-10 13:25 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
` (2 preceding siblings ...)
2004-09-10 13:25 ` bangerth at dealii dot org
@ 2004-09-10 13:43 ` gdr at integrable-solutions dot net
2004-09-10 14:20 ` bangerth at dealii dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-09-10 13:43 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
` (3 preceding siblings ...)
2004-09-10 13:43 ` gdr at integrable-solutions dot net
@ 2004-09-10 14:20 ` bangerth at dealii dot org
2004-09-28 13:41 ` gdr at gcc dot gnu dot org
2005-04-30 13:55 ` gdr at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-09-10 14:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-09-10 14:20 -------
| So, lo and behold, the compiler uses the spurious "double" template
| argument, rather than the "int" passed to the typedef. Very interesting...
On a more humorous note: gcc has just unwillingly acquired the ability to
do template-typedefs :-)
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
` (4 preceding siblings ...)
2004-09-10 14:20 ` bangerth at dealii dot org
@ 2004-09-28 13:41 ` gdr at gcc dot gnu dot org
2005-04-30 13:55 ` gdr at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-09-28 13:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2004-09-28 13:39 -------
Adjust milestone
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.3.5 |3.3.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/17391] [3.3 regression] template parameter accepted on typedef name
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
` (5 preceding siblings ...)
2004-09-28 13:41 ` gdr at gcc dot gnu dot org
@ 2005-04-30 13:55 ` gdr at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-04-30 13:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2005-04-30 13:55 -------
Not ciritcal for 3.3.6. Fixed in 3.4.1
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|3.3.6 |3.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17391
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-04-30 13:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-10 11:37 [Bug c++/17391] New: [3.3 regression] template parameter accepted on typedef name zak at transversal dot com
2004-09-10 11:38 ` [Bug c++/17391] " zak at transversal dot com
2004-09-10 13:23 ` bangerth at dealii dot org
2004-09-10 13:25 ` bangerth at dealii dot org
2004-09-10 13:43 ` gdr at integrable-solutions dot net
2004-09-10 14:20 ` bangerth at dealii dot org
2004-09-28 13:41 ` gdr at gcc dot gnu dot org
2005-04-30 13:55 ` gdr 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).