clang-tidy thinks it is parsing C

I am trying to run clang-tidy directly from the command line:
clang-tidy –

and it seems like clang-tidy thinks it is parsing C:

error: ‘uuid’ attribute is not supported in C

error: invalid argument ‘-std=c++1z’ not allowed with ‘C’…

How can I tell clang-tidy that the code is C++?


clang-tidy infers the language from the file extension or the compile_commands.json if present (this is not the case when using ‘–’ like you do).

Please use ‘.cpp’ as the file extension and try to set the ‘-std=c++11’ for now. Maybe your clang-tidy version is too old for ‘c++1z’.