User account creation filtered due to spam.

Bug 48838 - [4.6/4.7 Regression] valid template code does not compile
Summary: [4.6/4.7 Regression] valid template code does not compile
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.1
: P1 normal
Target Milestone: 4.6.1
Assignee: Dodji Seketeli
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-04-30 23:41 UTC by Bernd Buschinski
Modified: 2011-05-06 10:30 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.6.0
Known to fail: 4.6.1, 4.7.0
Last reconfirmed: 2011-05-02 10:32:20


Attachments
reduced testcase (148 bytes, text/x-c++src)
2011-04-30 23:41 UTC, Bernd Buschinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Buschinski 2011-04-30 23:41:26 UTC
Created attachment 24154 [details]
reduced testcase

gcc kdevtest2.cpp 
kdevtest2.cpp: In constructor 'DUChainItemRegistrator<T>::DUChainItemRegistrator()':
kdevtest2.cpp:13:50: error: expected primary-expression before '>' token
kdevtest2.cpp:13:52: error: expected primary-expression before ')' token

fails with
gcc 4.6.1 20110430 rev. 173224

works fine with
gcc 4.5.2

(some people told me that it also works fine with 4.6.1 20110329)
Comment 1 Paolo Carlini 2011-04-30 23:58:55 UTC
Note that like this, it still works:

  DUChainItemSystem::self().template registerTypeClass<T>();
Comment 2 Richard Biener 2011-05-02 10:32:20 UTC
Confirmed.  Regression on the branch, needs investigation.
Comment 3 Jakub Jelinek 2011-05-02 19:46:01 UTC
This started with:
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173123
Comment 4 dodji@seketeli.org 2011-05-03 20:15:50 UTC
A candidate patch was posted to
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00219.html
Comment 5 Dodji Seketeli 2011-05-06 08:34:18 UTC
Author: dodji
Date: Fri May  6 08:34:10 2011
New Revision: 173472

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173472
Log:
Fix PR c++/48838

gcc/cp

	PR c++/48838
	* cp-tree.h (non_static_member_function_p): Declare new function.
	* tree.c (non_static_member_function_p): Define it.
	* semantics.c (finish_call_expr): Use it.

gcc/testsuite

	PR c++/48838
	* g++.dg/template/member9.C: New test case.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/template/member9.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/cp-tree.h
    branches/gcc-4_6-branch/gcc/cp/semantics.c
    branches/gcc-4_6-branch/gcc/cp/tree.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 6 Dodji Seketeli 2011-05-06 08:35:00 UTC
Author: dodji
Date: Fri May  6 08:34:53 2011
New Revision: 173473

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173473
Log:
Fix PR c++/48838

gcc/cp

	PR c++/48838
	* cp-tree.h (non_static_member_function_p): Declare new function.
	* tree.c (non_static_member_function_p): Define it.
	* semantics.c (finish_call_expr): Use it.

gcc/testsuite

	PR c++/48838
	* g++.dg/template/member9.C: New test case.

Added:
    trunk/gcc/testsuite/g++.dg/template/member9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog
Comment 7 Jakub Jelinek 2011-05-06 10:30:30 UTC
Fixed.