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

Bug 363111

Summary: Automatically generated explicit constructor has the explicit keyword in constructor definition
Product: [Tools] CDT Reporter: Shayan <shayan.pooya>
Component: cdt-refactoringAssignee: Marc-André Laperle <malaperle>
Status: RESOLVED FIXED QA Contact: Emanuel Graf <emanuel>
Severity: minor    
Priority: P3 CC: cdtdoug, eclipse.sprigogin, malaperle
Version: 8.0.1Flags: eclipse.sprigogin: review+
Target Milestone: 8.0.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Remove explicit from definition, patch and test malaperle: iplog-, malaperle: review?

Description Shayan CLA 2011-11-07 19:33:55 EST
Build Identifier: M20110909-1335

If you declare an explicit constructor in a header file and use eclipse for generating the definition, the definition would include the explicit keyword. This is a bug and does not compile until the explicit keyword is manually omitted from the definition of the constructor.

Reproducible: Always

Steps to Reproduce:
1. Declare an explicit constructor in a header file
2. Right click on the header file and Source -> Implement Methods...
3. Select the explicit constructor in the list.
And the explicit keyword is generated in source file.
Comment 1 Marc-André Laperle CLA 2011-11-10 13:23:37 EST
Created attachment 206804 [details]
Remove explicit from definition, patch and test
Comment 2 Marc-André Laperle CLA 2011-11-10 13:31:14 EST
Sergey, would you mind reviewing this small patch? It removes explicit from definitions. I also checked in c++11 to make sure it's OK; explicit can also be used with conversion operators but I believe it should not be used in definitions either.
Comment 3 Sergey Prigogin CLA 2011-11-10 19:20:31 EST
The patch looks good to me.
Comment 4 Marc-André Laperle CLA 2011-11-11 13:11:17 EST
(In reply to comment #3)
> The patch looks good to me.

Thanks you. Fixed in 8.0.2 and master > 20111111.
Comment 5 CDT Genie CLA 2011-11-11 13:23:03 EST
*** cdt git genie on behalf of Marc-Andre Laperle ***

    Bug 363111 - Automatically generated explicit constructor has the
    explicit keyword in constructor definition

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=8a1269053a67c2bb97244dfdcf9c94b047fb2823
Comment 6 CDT Genie CLA 2011-11-11 13:23:04 EST
*** cdt git genie on behalf of Marc-Andre Laperle ***

    Bug 363111 - Automatically generated explicit constructor has the
    explicit keyword in constructor definition

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