Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 52186

Summary: A C++ template bug.
Product: [Retired] Red Hat Linux Reporter: hjl
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: jeremy
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-01 23:46:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A testcase
none
A patch
none
A new patch
none
A testcase
none
A new testcase
none
Another testcase
none
A new patch
none
A new patch
none
Another testcase
none
A new patch none

Description hjl 2001-08-21 15:21:19 UTC
# gcc -c template.cc
template.cc: In method `a<A>::a ()':
template.cc:15: parse error before `>'
template.cc: In method `void a<A>::foo ()':
template.cc:21: parse error before `>'

Comment 1 hjl 2001-08-21 15:22:01 UTC
Created attachment 28715 [details]
A testcase

Comment 2 hjl 2001-08-21 15:22:33 UTC
gcc 3.1 still fails to compile it.

Comment 3 hjl 2001-08-22 00:56:18 UTC
Created attachment 28814 [details]
A patch

Comment 4 hjl 2001-08-22 00:57:19 UTC
I am enclosing a patch. It seems to work for the testcase. But I have
NO idea if it is correct at all.

Comment 5 hjl 2001-08-22 12:50:15 UTC
Created attachment 28895 [details]
A new patch

Comment 6 hjl 2001-08-22 12:52:19 UTC
I bootstrapped gcc 2.96 without regression.

Comment 7 Jakub Jelinek 2001-08-22 12:56:43 UTC
Can you please mail this to gcc-patches yourself?
I don't think I have to act as an interface between you and Jason/Mark
and this is a gcc 3.x bug. Once some patch is agreed on, I'll of course put
it in.

Comment 9 Jakub Jelinek 2001-08-23 20:31:50 UTC
But you haven't mention that the bug is present in 3.0 and 3.1 too.

Comment 10 hjl 2001-08-23 20:38:44 UTC
Created attachment 29275 [details]
A testcase

Comment 11 hjl 2001-08-23 20:39:22 UTC
Created attachment 29276 [details]
A new testcase

Comment 12 hjl 2001-08-23 20:41:00 UTC
It is a very strange bug. My last patch is not complete/correct.

# diff -up 1.cc 2.cc
--- 1.cc        Thu Aug 23 13:45:48 2001
+++ 2.cc        Thu Aug 23 13:45:30 2001
@@ -15,7 +15,7 @@ struct a
        }
 
        template<typename T>
-       void get() {
+       void set() {
        }
 };
# gcc 1.cc 2.cc -c
2.cc: In method `a<A>::a ()':
2.cc:14: parse error before `>'





Comment 13 hjl 2001-08-24 00:04:00 UTC
Created attachment 29298 [details]
Another testcase

Comment 14 hjl 2001-08-24 00:05:41 UTC
My patch doesn't help much in this new testcase.

# gcc -c 3.cc
3.cc: In method `void a<A>::a1 ()':
3.cc:33: parse error before `>'
3.cc: In method `void a<A>::a2 ()':
3.cc:40: parse error before `>'
3.cc: In method `void a<A>::a3 ()':
3.cc:47: parse error before `>'
3.cc: In method `void a<A>::a4 ()':
3.cc:54: parse error before `>'
3.cc: In method `void a<A>::a5 ()':
3.cc:61: parse error before `>'
3.cc: In method `void a<A>::a6 ()':
3.cc:68: parse error before `>'
3.cc: In method `void a<A>::a7 ()':
3.cc:76: parse error before `>'
3.cc: In method `void a<A>::a8 ()':
3.cc:84: parse error before `>'


Comment 15 hjl 2001-08-24 07:16:55 UTC
Created attachment 29346 [details]
A new patch

Comment 16 hjl 2001-08-24 07:20:34 UTC
Here is a new patch. It seems to work
with 3.cc. BTW, I am not sure if the
gcc people think it is a real problem
since I got zero response from the gcc
mailing list.

Comment 17 hjl 2001-08-24 07:22:49 UTC
My patch is not correct. I just hope it
leads to a real fix.

Comment 18 hjl 2001-08-24 20:14:46 UTC
Created attachment 29417 [details]
A new patch

Comment 19 hjl 2001-08-24 20:15:29 UTC
My new patch seems to work and causes no
regressions in gcc 2.96.

Comment 20 hjl 2001-08-25 22:55:06 UTC
Created attachment 29614 [details]
Another testcase

Comment 21 hjl 2001-08-25 22:56:03 UTC
I uploaded another testcase. I am
testing a new patch now.

Comment 22 hjl 2001-08-27 05:35:57 UTC
Created attachment 29674 [details]
A new patch

Comment 23 Richard Henderson 2004-10-01 23:46:13 UTC
Fails through gcc 3.2; fixed in gcc 3.3.