You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intellisense does not assume C23 when using CMake with c_std_23 #14560
Create a basic Cmake file using c_std_23 as the language version. Then generate with compile commands.
In VSCode, things like nullptr, bool etc are not at all recognized.
What is really happening is that CMake correctly assumes that C23 is the standard for GCC and completely omits -std=c23 (or gnu23) from the command-line in compile-commands.json. Hence, the language server does not know that C23 is used and just falls back to C99 (likely). Clangd shows this exact same behavior. C99 is no longer a correct default to fall back to. Hasn't been for a while.
Expected behavior:
Intellisense should be compiler version aware and know that C23 is implicit if no flags are specified.
Configuration and Logs
The fix is just to specify C23 in c_cpp_properties.json. If this file is not provided; intellisense defaults are incorrect:
Robin 'Ruadeil' Degen (@robindegen) It appears that gcc 15 switched the default standard to C23, but not gcc 14 or earlier or with the latest clang or msvc compilers.
IntelliSense is using c17 by default because gcc is reporting __STDC_ISO_10646__ 201706L as the define.
Robin 'Ruadeil' Degen (@robindegen) It appears the gcc default is actually C17, but it's silently accepting C23 code: __STDC_ISO_10646__ is still 201706L.
Robin 'Ruadeil' Degen (@robindegen) It appears to use C23 because gcc is implementing those particular C23 features you're using as a language extension for C17, which our EDG compiler doesn't properly take into account yet.
Activity
sean-mcmanus commentedon Jul 3, 2026
Robin 'Ruadeil' Degen (@robindegen) It appears that gcc 15 switched the default standard to C23, but not gcc 14 or earlier or with the latest clang or msvc compilers.
IntelliSense is using c17 by default because gcc is reporting
__STDC_ISO_10646__201706L as the define.sean-mcmanus commentedon Jul 3, 2026
Robin 'Ruadeil' Degen (@robindegen) It appears the gcc default is actually C17, but it's silently accepting C23 code:
__STDC_ISO_10646__is still 201706L.sean-mcmanus commentedon Jul 3, 2026
Robin 'Ruadeil' Degen (@robindegen) It appears to use C23 because gcc is implementing those particular C23 features you're using as a language extension for C17, which our EDG compiler doesn't properly take into account yet.
sean-mcmanus commentedon Aug 27, 2026
Actually, I was mistaken. GCC does use C23 by default -- the bug appears to be we're incorrectly setting the default as c17.
sean-mcmanus commentedon Aug 29, 2026
Robin 'Ruadeil' Degen (@robindegen) Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.34.1 (pre-release).