Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352266 - Syntax error when unnamed template parameter has default value
Summary: Syntax error when unnamed template parameter has default value
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.0.1   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-16 06:22 EDT by Nathan Ridge CLA
Modified: 2011-07-20 11:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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