Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
60 views

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 ...
Oersted's user avatar
  • 3,732
1 vote
1 answer
50 views

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::...
Kristen777's user avatar
2 votes
3 answers
239 views

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 ...
Fedor's user avatar
  • 24.7k
1 vote
1 answer
100 views

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 ...
aniket's user avatar
  • 21
0 votes
0 answers
32 views

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 ...
Mikhail T.'s user avatar
  • 4,256
5 votes
2 answers
161 views

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: ...
barnabas's user avatar
  • 157
1 vote
0 answers
39 views

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 ...
Dalzhim's user avatar
  • 2,088
2 votes
2 answers
112 views

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() {...
Alexander Torstling's user avatar
-3 votes
1 answer
127 views

Platform: aarch64, android 14, clang 20.1.6 (latest version), llvm 20.1.6, kernel 5.4.254-qgki-ga443 Code: int start_game(void) { } int main(int argc, char **argv) { start_game(); } Problem: My ...
Two Spikes's user avatar
0 votes
0 answers
20 views

I am working on a program that outputs a C++ AST to a form that can be injested by the Rocq theorem prover. For many things, this works well, but Clang seems to compute some information lazily and ...
Gregory's user avatar
  • 1,305
10 votes
1 answer
227 views

I recently encountered an interesting C++ code example that compiles with Clang (-std=c++20) but fails with GCC and MSVC. The code involves operator overloading and friend function declarations. Code ...
Caesium1337's user avatar
5 votes
1 answer
196 views

I have some code which is showing odd behavior when std::is_sorted() is called twice in a row; the result changes! The fist call returns false and the second call returns true. This happens with the ...
Michael Conlen's user avatar
2 votes
0 answers
336 views

I'm trying to remove all clang-tidy warnings in my C++ project. But I get alternating modernize-deprecated-headers and misc-include-cleaner warnings. For example: I use open_memstream in a file, so I ...
DeZe's user avatar
  • 23
4 votes
1 answer
184 views

I'm using GCC 14 and Clang 21. Why is the next C++23 code refused by GCC but Clang compiles without problems ? Both seems to support this functionality of C++20 and I'm using C++23. I think I've read ...
informaticienzero's user avatar
0 votes
0 answers
30 views

I've been doing some tests to try to use LLVM to build a big 20 year old project developed with GCC. Among the vast number of issues one of the problems is with old Qt headers. We're building with -...
Paul Floyd's user avatar
  • 7,170
3 votes
0 answers
60 views

Here is the test code: #include <type_traits> enum class ShaderType:unsigned{ Vertex = 0, Fragment = 1, }; template<ShaderType type> struct ShaderTypeHolder{ static constexpr ...
Shenghua Lin's user avatar
1 vote
0 answers
16 views

I have been dealing with a lot of errors in my C++ code and then just realized I am running c++ 98. I am writing this for some help with updating it to c++20 or 17. From everything I have read, I have ...
Marcus Hauen- Limkilde's user avatar
0 votes
0 answers
135 views

I’m currently testing an interesting ARM64-to-x86_64 emulator implemented within the Xcode iOS Simulator. The goal is to enable Intel Macs to run ARM64 iOS binaries. Part of the emulator’s code relies ...
Jesus Martinez's user avatar
0 votes
0 answers
57 views

I've encountered a bug when using Clang[1] with libomp[2] whereby using omp_priv = omp_orig in the initializer of a custom OpenMP reduction silently gives erroneous output. For example: /* file.cpp */ ...
Anti Earth's user avatar
  • 4,941
1 vote
1 answer
307 views

I have a simple C++ program that does nothing: int main() { return 0; } I am trying to build this program completely statically using the following command: g++ -o c c.cc -static Everything works ...
Mehrab's user avatar
  • 19
4 votes
1 answer
124 views

While I was playing with constexpr function, I faced the following issue. Accessing inactive member of union is undefined behaviour I know. But there is one exception for this rule. According to C++23 ...
Ahmet Dundar's user avatar
1 vote
0 answers
119 views

Assume the following function: const std::vector<std::unique_ptr<T>>& Foo::bar(); I'd like to refactor it to: const std::vector<T>& Foo::bar(); And then, I'd like to ...
Semin Park's user avatar
2 votes
2 answers
197 views

I have a C++20 program that can be successfully built in Ubuntu 20 with GCC 10 or in Visual Studio 2019. And now I need to compile it for macOS 13.7.2 x64 (currently available on GitHub-hosted runner),...
Fedor's user avatar
  • 24.7k
0 votes
1 answer
39 views

I'm exploring the LLVM/Clang source code and interested in understanding how LLVM distinguishes between clang and clang++ commands, knowing that clang++ is often considered an alias of clang. Which ...
Henry's user avatar
  • 587
1 vote
2 answers
154 views

Mac M1. I learn C++ by Bjarne Stroustrup's book. He show the similar example in his "Programming. Principles and Practice Using C++" book (chapter 5.6.2). Also he writes this exception (...
Andrey Bushman's user avatar

1
2 3 4 5
43