microsoft / microsoft/vscode-cpptools
Stop converting the "-std=c++0x" to "-std=c++11"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
So I have this weird issue, my project is using gcc 4.6.3, and it looks like the compiler has a bug, that vscode rightfully gives an error about, but the code builds. It's a bit annoying and isn't cool overall. What can I do about this issue?
The bug is as follows:
I have a struct, let's say struct Foo { int id; std::unordered_set<int> set; };. My class has a private member of this struct, and it initializes it in initialization list like this : member({ 0, { } }).
The problem with this is that gcc 4.6.3 unordered_set default constructor is explicit, which is why member({ 0, { } }) gives an Intellisense error, according to C++11. However, if this was actually an invalid code, I would write member({ 0, std::unordered_set<int>{ } }) (which is subjectively less pretty), but standard actually says that unordered_set default constructor is not supposed to be explicit, and so my code builds correctly in later gcc versions.
Is my only option to either update gcc or to write ugly code just to satisfy IntelliSense?
Another option would be to ignore it, but let's not talk about this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported behavior with GCC 4.6.3 and a project using -std=c++0x, then trace where the C++ extension converts that setting to -std=c++11. Done means the original standard flag is preserved while IntelliSense continues to report diagnostics consistently with the compiler.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100