Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352266

Summary: Syntax error when unnamed template parameter has default value
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: All   
OS: All   
Whiteboard:

Description Nathan Ridge CLA 2011-07-16 06:22:23 EDT
The parser marks the following code as a syntax error:

template <typename = int>
class A {};

The code compiles fine with GCC. I believe it is valid.
Comment 1 Markus Schorn CLA 2011-07-18 02:43:27 EDT
You are right, this is legal C++ code.
Comment 2 Markus Schorn CLA 2011-07-20 10:19:57 EDT
Added testcase, fixed in 8.0.1 > 20110720.
Comment 3 CDT Genie CLA 2011-07-20 11:19:33 EDT
*** cdt git genie on behalf of 352266 ***

    Bug 352266: Template paramter without name, but with default value

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=9840061bd608aaf9b5a14c38dbb7da8bca9bd097
Comment 4 CDT Genie CLA 2011-07-20 11:19:35 EDT
*** cdt git genie on behalf of 352266 ***

    Bug 352266: Template paramter without name, but with default value

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=1215f963145bf3cf9402316a91686b6243c16137