clang-tidy thinks it is parsing C

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clang-tidy thinks it is parsing C

Eric Fiselier via cfe-dev
I am trying to run clang-tidy directly from the command line:
clang-tidy <file> -- <compilation flags>

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++?

Tiago

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang-tidy thinks it is parsing C

Eric Fiselier via cfe-dev

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'.


Am 17.10.2017 um 11:08 schrieb Tiago Macarios via cfe-dev:
I am trying to run clang-tidy directly from the command line:
clang-tidy <file> -- <compilation flags>

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++?

Tiago


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev