Closed Bug 1726430 Opened 4 years ago Closed 4 years ago

Generated visual studio solution and projects give intellisense warnings for C++17 features

Categories

(Firefox Build System :: General, defect, P3)

defect

Tracking

(firefox95 fixed)

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: bryce, Assigned: ahochheiden)

Details

Attachments

(1 file)

When working with the generated VisualStudio files for mozilla-central, VisualStudio seems to prefer the C++14 standard for intellisense. This results in it generating warnings and red squigglies for things like

  • std library features only available in C++17
  • nested name spaces, e.g. namspace mozilla::media
  • inline usage on variables

This isn't a big problem, but it would be nice to have VisualStudio recognize C++17 code.

If I create a solution in VisualStudio 2019 I can navigate to the Properties -> General page for the solution and change the standard version used. However this isn't available for my Moz generated projects.

FWIW, toggling the standard version on a project seems to set something like the following in the project file

<LanguageStandard>stdcpp17</LanguageStandard>

Is it possible to set the standard in the generated files?

Priority: -- → P3
Assignee: nobody → ahochheiden
Status: NEW → ASSIGNED

Adding the <LanguageStandard> field and playing around with the values did not work for me.

Adding /std:c++17 to <AdditionalOptions> under the NMake project properties made IntelliSense use C++17 for my testing. (No red squiggles warnings for C++17 style nested namespaces eg: namspace mozilla::media{};)

I've submitted a patch that adds the /std:c++17 value for <AdditionalOptions> on VS Project Generation.

Attachment #9245638 - Attachment description: Bug 1726430 - Updated Visual Studio project file generation to set C++17 as the language standard for IntelliSense for all projects. r?mhentges → WIP: Bug 1726430 - Updated Visual Studio project file generation to set C++17 as the language standard for IntelliSense by adding /std:c++17 to <AdditionalOptions> for all projects.
Attachment #9245638 - Attachment description: WIP: Bug 1726430 - Updated Visual Studio project file generation to set C++17 as the language standard for IntelliSense by adding /std:c++17 to <AdditionalOptions> for all projects. → Bug 1726430 - Updated Visual Studio project file generation to set C++17 as the language standard for IntelliSense by adding /std:c++17 to <AdditionalOptions> for all projects. r?mhentges
Pushed by mhentges@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bdfd88ac2490 Updated Visual Studio project file generation to set C++17 as the language standard for IntelliSense by adding /std:c++17 to <AdditionalOptions> for all projects. r=mhentges
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: