Questions tagged [clangpowertools]

Clang Power Tools is a Visual Studio extension helping C++ developers modernize and transform their code to C++11/14/17/20 standards by using LLVM's static analyzer and CppCoreGuidelines.

Bringing clang-tidy magic to Visual Studio C++ developers

More details:

9 questions
4
votes
1 answer

Why does Clang not allow "and" as function name?

I'm developing a program for some time now, using Visual Studio 2017. Lately I installed the Clang Power Tool extension in order to check the quality of my code. Part of my program consists in emulating the opcodes of a cpu. I created a stripped…
Runik
  • 155
  • 1
  • 9
3
votes
1 answer

How to use clang-tidy with Visual Studio and CMake?

My ultimate goal is to do a one-off automated modernization of some code and apply our identifier capitalization rules that are expressed in .clang-tidy. Being able to repeat this over time would be nice. We use Visual Studio 2015, CMake 3.13, and…
All The Rage
  • 743
  • 5
  • 24
3
votes
1 answer

Wrong 32-bit calling convention for InterlockedExchange for Clang++, but MSVC is fine

I am using clang power tools to compile a project which is usually compiled using visual studio. In boost's lwm_win32.hpp header (yes we are using an old version of boost and currently cannot update) I get an error reading. function declared…
sigy
  • 2,408
  • 1
  • 24
  • 55
3
votes
1 answer

C++ using clang-tidy with external libraries

I'm first time user of clang-tidy. I am working on my thesis using OpenCV. My issue is that when I configure clang-tidy to "Fix" the issues it finds, it will fix the issue it finds in the OpenCV library as well. My question is: how can I make it so…
Marius T
  • 783
  • 5
  • 10
2
votes
1 answer

How can you generate a JSON compilation database using the CLI?

As described here one can generate a JSON compilation database using the UI of Visual Studio. Is it possible to do this in the CLI? (The use case for this is to use the database with clangd to provide autocompletion to another editor)
Jerome Reinländer
  • 1,227
  • 1
  • 10
  • 26
2
votes
1 answer

clangTidy linting corecrt_wstdio.h

i am attempting to use clangTidy on a legacy codebase. in trying the simplest test case on one file, i am getting this error that i have no idea how to prevent. I believe this comes from my file including StdAfx, which includes some standard…
austinrulezd00d
  • 215
  • 4
  • 14
2
votes
2 answers

clang-tidy on Windows with MSVC2015

I try to use clang-tidy on Windows - so far without being successfull. As a precondition I've installed LLVM 3.9.1. My normal compiler is MSVC 2015, my build system is QBS 1.7.2. Using QBS I have generated compile_commands.json. Of course that file…
0
votes
1 answer

Clang Power Tools VsWhere could not detect Visual Studio 2017

just installed Clang Power Tools for VS 2019 Community, I go to build and it throws with the following error: throw "VsWhere could not detect Visual Studio $($global:c ... + CategoryInfo : OperationStopped: (VsWhere could n... Studio 2017…
Sixjac
  • 339
  • 4
  • 16
-2
votes
1 answer

Why does a function call missing its name still compile?

A developer was copying and pasting similar types of code and made a mistake where instead of int x = 100; int y = 100; int z = 100; aFunction(x, y, z); They accidentally typed int x = 100; int y = 100; int z = 100; (x, y, z); //What does…
Donald Herman
  • 314
  • 1
  • 5
  • 15