Bug 544687 - Definition of aggregate c++17 vs c++20
Summary: Definition of aggregate c++17 vs c++20
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: cxx20
  Show dependency tree
 
Reported: 2019-02-21 16:15 EST by Hannes Vogt CLA
Modified: 2020-09-04 15:20 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 Hannes Vogt CLA 2019-02-21 16:15:43 EST
The following struct is an aggregate from c++11 to c++17, though, if I understand correctly, it isn't in c++20. By accident cdt thinks it is not an aggregate for  the correct reason for c++20 (user-declared ctor). What to do? As far as I understand there is no mechanism to distinguish c++ versions?

struct type {
	int value;
	type() = default;
};

int main(){
	type{2}; // cdt doesn't find a ctor
}
Comment 1 Nathan Ridge CLA 2019-02-21 18:57:37 EST
The policy so far has been that CDT implements the latest version of the language (to the extent that the changes have been implemented in CDT).

If someone has the motivation to contribute support for different language versions at the same time, controlled via some option, I would accept patches for that.