microsoft / microsoft/vscode-cpptools
Stop converting the "-std=c++0x" to "-std=c++11"
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riprodurre il comportamento segnalato con GCC 4.6.3 e un progetto che usa -std=c++0x, quindi tracciare il punto in cui l’estensione C++ converte quell’impostazione in -std=c++11. Il lavoro è completato quando il flag dello standard originale viene preservato e IntelliSense continua a segnalare diagnosi coerenti con il compilatore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript, vscode
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100