Category "clang"

clang DeclContext::getParent() not returning parent RecordDecl for nested structs

I'm using the following code get parent struct of a nested struct using clang libtooling. bool VisitRecordDecl(clang::RecordDecl *RD) { llvm::outs() <<

Clang compilation into sysroot with newer glibc

I'm trying to compile with a sysroot for Ubuntu 22.04 from a Ubuntu 20.04 image, and I'm having quite a bit of trouble, getting linker errors like these: /usr/b

How to setup VS Code for C++ with clangd support?

Disclaimer: I am totally knew to VS Code, so, please, be gentle with me. :-) I am trying to set up VS Code for C++. However, I explicitly want to set it up so

How to install and use just Clang-Format on Fedora 27?

I'm trying to figure out how to install the stand alone Clang-Format tool. I've downloaded the pre build binaries for Clang from the official download page for

lld runs LTO even if -fno-lto is passed

I have a CMake project with several subprojects that create static libraries built with -flto=thin. The project has a lot of tests that are linked against the a

ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-nightly' Reader: 'LLVM APPLE_1_1300.0.29.3_0') for architecture arm64

Trying to install and work with zkgroup. Build, run for specific iOS device working fine. But generic archiving is not working. Error text: ld: Invalid value (P

clang: What does emitting mean?

The clang diagnostics reference uses the word emit three times. The following warnings use this term. Example 1: Compile this with -Wunneeded-internal-declarati

Warning: function 'F' is not needed and will not be emitted

Here is a little program (live on godbolt): static void UnusedDeclaration(); static void UnusedDefinition() {} static void Declaration(); decltype(Declaration(

How can I include a C header that uses a C++ keyword as an identifier in C++?

I've been using C++ and compiling with clang++. I would like to include the <xcb/xkb.h> header for an X11 program I am writing. Unfortunately this header

make Clang-Format ignore comments for line break

Is it possible to tell Clang-Format to ignore comments for line break operations? The idea is to follow the style "the code is well formatted, even if comments

Clang-Tidy `NOLINT` for multiple lines?

I'm working on a C++ project that has some large sections of code that are autogenerated, and I don't want to be linted. Is there something akin to the //NOLINT

How to compile/use header unit modules under CLang C++?

It is said in docs that modules support in CLang is partial. I'm using CLang under Windows 64-bit from recent release of LLVM 12.0. I successfully managed to us

macos llvm-symbolizer not found

I am trying to use address sanitization when calling my program with clang, however it doesn't seem to be installed. If I type which llvm-symbolizer I get llvm-

How to remove "noise" from GCC/clang assembly output?

I want to inspect the assembly output of applying boost::variant in my code in order to see which intermediate calls are optimized away. When I compile the fol

How can I install clang-format in Ubuntu?

I am trying to use clang-tools in particular clang-format for automatic code formatting in vim but I couldn't find this tool with apt-get search. Is there anyb

Linking EFI application with LLVM on MacOS

I'm attempting to cross-compile and link a very simple EFI application that is using the EFI headers from the Zircon kernel. Despite my best efforts, I am unabl

clang linker error when compiling simple C program on OS X

I was building this code from this article I was using the recommended command to build it: gcc -Wall -o keyboard_leds keyboard_leds.c -framework IOKit -framewo

Switching between GCC and Clang/LLVM using CMake

I have a number of projects built using CMake and I'd like to be able to easily switch between using GCC or Clang/LLVM to compile them. I believe (please correc

Clangd in VSCode: .clang-format and .clang-tidy files

I've been trying to setup my VSCode to work with Clangd as a LSP server for my Cpp projects. I've successfully established basic functions such as the LSP itsel

Bazel 0.29.1 LLVM-7.0 on Centos 7

So I have a docker with CentOS 7 which has installed bazel. I've installed devtoolset-8, llvm-toolset-7.0 and centos-release-scl. I've also installed bazel 0.29