Community
Participate
Working Groups
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.
Created attachment 206804 [details] Remove explicit from definition, patch and test
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.
The patch looks good to me.
(In reply to comment #3) > The patch looks good to me. Thanks you. Fixed in 8.0.2 and master > 20111111.
*** 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
*** 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