therisktaker - 2022-12-23

UPDATE:

I build Cppcheck from source from current top (Cppcheck 2.10 dev) - commit 3136a50b9). Looks like it is already fixed.


Hi

When I run Cppcheck 2.9 with this command:

cppcheck --enable=all main.cpp

on this code:

// main.cpp
#if __has_include(<string_view>)
#endif

int main()
{
    int a;
}

I always get:

main.cpp:1:0: error: failed to evaluate #if condition [preprocessorErrorDirective]
#if __has_include(<string_view>)
^

on Windows and Linux.

It does actually work with quotation marks __has_include("something"), but doesn't with angle brackets __has_include(<something>)

 

Last edit: therisktaker 2022-12-23