Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense between c++98 and c++03 is different #5225

Closed
ghuser404 opened this issue Mar 29, 2020 · 6 comments
Closed

IntelliSense between c++98 and c++03 is different #5225

ghuser404 opened this issue Mar 29, 2020 · 6 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@ghuser404
Copy link

While testing #5220, I noticed that if I specify "cppStandard": "c++98" in c_cpp_properties.json, I do not get red squiggles for code below, but if I specify "cppStandard": "c++03", then I do. That is without CMake Tools extension.

I also do get red squiggles when I use CMake Tools extension as configuration provider "configurationProvider": "ms-vscode.cmake-tools" and having target_compile_features(test PRIVATE cxx_std_98) in CMakeLists.txt.

The error is error: '>>' should be '> >' within a nested template argument list.

#include <vector>

int main()
{
    std::vector<std::vector<int>> v;
    return 0;
}
@sean-mcmanus
Copy link
Contributor

error: '>>' should be '> >' within a nested template argument list is from gcc and not our IntelliSense, but it appears our IntelliSense is not configured correctly when c++98 is used. The workaround is to use c++03.

@ghuser404
Copy link
Author

Yeah, this error is from gcc. With c++03 cpptools gives space required between adjacent '>' delimiters of nested template argument lists ('>>' is the right shift operator) - but you get the idea.

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Mar 30, 2020
@sean-mcmanus sean-mcmanus removed their assignment Mar 30, 2020
@sean-mcmanus
Copy link
Contributor

@ghuser404
Copy link
Author

This now works correctly. However, like I mentioned in #5157, I get Standard Version: c++03 with either "cppStandard": "c++98" or "compilerArgs": ["-std=c++98"]. Not sure if this is a problem?

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 30, 2020

Yeah, that is correct -- our back-end parser treats C++98 and C++03 identically (I think they're very similar). Previously, using "c++98" was causing some later standard to be used.

@elahehrashedi
Copy link
Contributor

This issue is fixed in 0.28.0.
0.28.0 release: https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
None yet
Development

No branches or pull requests

3 participants