microsoft / microsoft/vscode-cpptools
Stop converting the "-std=c++0x" to "-std=c++11"
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das gemeldete Verhalten mit GCC 4.6.3 und einem Projekt, das -std=c++0x verwendet, und verfolge anschließend, wo die C++-Erweiterung diese Einstellung in -std=c++11 umwandelt. Als abgeschlossen gilt die Aufgabe, wenn das ursprüngliche Standard-Flag erhalten bleibt und IntelliSense weiterhin Diagnosen konsistent mit dem Compiler meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, typescript, vscode
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100