Eclipse CDT C++ Aggregate (brace) Initialization fails with newer eclipse Versions [message #1829278] |
Tue, 30 June 2020 07:37  |
Eclipse User |
|
|
|
Preconditions:
Existing C++ code works fine with eclipse 2018-12 and compiles error and warning free.
Problem Description:
C++ aggregate (brace) initialization fails with newer eclipse versions 2019-03 - 2020-06.
Examples:
1. String initialization with function return value
std::string getVersStr() // method declaration
std::string tempSrcStr{getVersStr()}; // eclipse complains with 'invalid arguments'
2. Aggregate initialization in class initialization list
...
private:
std::list<Port> portList;
public:
PortMap(const std::list<Port> &_portList) : portList(_portList) // eclipse complains wirh symbol 'portList' could not be resolved
...
For sure using round brackets instead of braces works.
But I don't wan't to change lots of code lines in order just to satisfy eclipse, when code compiles fine and works fine with older eclipse version 2018-12.
I don't understand why such code affecting changes are necessary from one eclipse version to other.
Question:
Is there any possibility to make eclipse accepting such aggreagate initializations?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24826 seconds