2,119 questions
0
votes
0
answers
63
views
check_ipo_supported returns false on windows when using clang++ provided by MSYS2
On windows, using check_ipo_supported CMake function gives the following results:
compiler
generator
check_ipo_supported
msvc
NMake Makefiles
TRUE
g++ (from MSYS2)
MinGW Makefiles
TRUE
clang++ (from ...
2
votes
1
answer
143
views
Clangd query driver still uses clang source dir
Recently i've been working on some project with GNU arm compiler for C++ project. I've configured clangd to use this compiler with query-driver as clangd documentation recommends. The problem is ...
1
vote
1
answer
52
views
How can I correlate a clang::CXXMethodDecl with documentation comments that are in the header?
I am learning to work with the clang AST while developing a refactoring tool.
I'm using a clang::ast_matchers::dynamic::DynTypedMatcher created using the clang::ast_matchers::dynamic::Parser::...
-5
votes
1
answer
208
views
How do I get my existing MSVC project to compile with the Visual Studio 2022 Clang compiler?
I have an existing c++ project that compiles fine with msvc, and I'm trying to get it to compile in Visual Studio 2022 with LLVM (clang-cl). At the moment I'm using C++ Language Standard Preview ISO C+...
2
votes
3
answers
239
views
How to detect C++20 mode of compilation?
When compiling my program using a recent version of OpenVDB library by Clang in C++20 mode, I get the error:
error: use of the 'assume' attribute is a C++23 extension
I see that it is due to the ...
14
votes
2
answers
324
views
Is clang broken with `-std=c++20` and `-Wdtor-name`
Consider this simple code.
struct Foo {
template <typename T>
struct Bar {
~Bar();
};
};
with the out-of-line implementation
template <typename T>
Foo::Bar<T>::~...
1
vote
1
answer
107
views
How to rebuild Clang 16.0.0 on Ubuntu 22.04 so it links with `libtinfo6` instead of `libtinfo5`?
I’m working on a legacy C++ codebase that ships with its own Clang 16 inside a thirdparty/llvm-build-16 folder. On our new Ubuntu 22.04 build system, this bundled compiler fails to run because it ...
3
votes
1
answer
114
views
Why does Clang fail to compile, but GCC succeeds, with identical ~/.zshrc configuration?
On my Apple M2 (ARM64-apple-darwin) I have the following C++ code stored in the file hello_world.cpp in some directory called code.
I want to be able to compile it using both Clang and GCC, but ...
0
votes
0
answers
34
views
How to combine PyVarObject_HEAD_INIT and designated initializers?
In my own "native" Python module I declare a new type this way:
PyTypeObject calculatorType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "My.Calculator",
.tp_basicsize ...
2
votes
1
answer
109
views
How to put source information in the debug symbols without embedding the full sources on Linux?
MSVC has a very useful flag /SOURCELINK. This allows you to tell where in your versioning system the sources are stored, such that they can be downloaded.
For example: (Also holds for C++)
{
"...
5
votes
2
answers
161
views
Is this assignment to brace-enclosed string constant really illegal in C++?
I am porting a large codebase from Linux/g++ to MacOS/Clang. I hit this compiler error in multiple places in Clang (where g++ builds successfully and does the right thing at run time):
error: ...
0
votes
1
answer
191
views
Xcode 26 clang doesn't support sized deallocation
The clang compiler shipping with Xcode 26 does not support sized deallocation:
void* p = operator new(100);
// [...]
operator delete(p, 100); // error: no matching function for call to 'operator ...
1
vote
0
answers
39
views
Can HWASAN support runtime suppressions?
The design document for Hardware-assisted AddressSanitizer does not document whether or not runtime suppressions are possible using the HWASAN_OPTIONS environment variable.
Assuming a program compiled ...
0
votes
1
answer
241
views
Building .NET MAUI app for iOS fails with "clang++ exited with code 1"
I am developing a mobile app in .NET Maui with .NET 8.0 for both Android and iOS using the latest Release of Visual Studio 2022 and a Windows PC. Everything worked very well until this week. I can no ...
2
votes
2
answers
114
views
Can clang -ffast-math optimize away comparison between quiet_NaN and float?
I noticed that the following program optimizes to no instructions at all on recent versions of clang, with -ffast-math and -O1 and higher:
#include <cassert>
#include <limits>
int main() {...