All Questions
5,276
questions
0
votes
0
answers
46
views
ambiguous partial specializations
I have a big 3rd party library that I am trying to compile with latest clang (version 19) and I keep running into ambiguous partial specializations error. A minimal sample to reproduce the issue looks ...
0
votes
0
answers
26
views
Standard library not detected in my custom Clang Tool
I have the following code (Want to Develop a CXX refactoring tool)
using namespace clang;
int main(int argc, const char **argv) {
static llvm::cl::OptionCategory KsaiToolOptions("my_tool ...
0
votes
0
answers
32
views
Address Sanitizer do not show nothing and lsan_is_turned_off
I'm trying to use address sanitizer in my main.cpp on Windows.
Makefile:
default:
clang++ main.cpp -o app.exe -fsanitize=address -g
set ASAN_OPTIONS=detect_leaks=1
./app.exe
main.cpp
#...
0
votes
0
answers
47
views
Clang++ issue in linkling std libraries
I'm trying to build a program using clang++, on a Ubuntu 22.04 PC.
clang version: Ubuntu clang version 14.0.0-1ubuntu1.1
gcc version 11.4.0
The SW compiles and links fine using g++ with the ...
1
vote
1
answer
70
views
gcc and clang disagree on using alias templates as template template argument [duplicate]
The code below compiles using gcc 14.1.1 but clang 18.1.8 doesn't accept it. Which one is right and is there any workaround?
template <template <typename...> class T>
struct s {
...
0
votes
1
answer
59
views
Use a lambda which captures this to initialize a struct member cause a segment fault in clang?
I use a lambda which captures this to initialize the struct member std::function f. The program is expected to print 9, but got a Segmentation fault.
My compile command is clang++ prog.cc with clang17....
10
votes
0
answers
206
views
Semantics of volatile std::atomic<T>
Generally std::atomic<T> does not imply semantics of volatile, i.e. operations on the atomic object are not observable side effects that the compiler needs to preserve.
As a consequence the ...
2
votes
1
answer
29
views
Parse clang AST from `compile_commands.json` ignoring PCH
I'm trying to parse an AST of the whole project using a compilation database (compile_commands.json), but it contains pch files and commands related to generate those, resulting in errors during ...
-5
votes
0
answers
51
views
VSCode C++ ld: symbol(s) not found for architecture arm64 problem in Mac [closed]
I have issue about the vscode with c++ when i run the single file like hello world its working good but gives this error when the header file and other files are included in the include event
When ı ...
-2
votes
2
answers
58
views
Call file-private function before its definition without manual declaration [duplicate]
For code modularity I like to subdivide long functions into a few smaller ones like so
void main_function() {
step_1();
step_2();
}
static inline void step_1() {
// code
}
static inline ...
-2
votes
0
answers
23
views
Swig CLang C++ Libraries Exceptions Crash Our Android App [closed]
Our android app have business layer which developed by c++ and deployed with swig clang and ndk23 to so libraries. Before ndk23 we have use gnu compiler and ndk15 and it works without problem if we ...
-1
votes
0
answers
45
views
Based on `Microsoft` style, how does clang-format automatically delete the blank line before the left brace? [closed]
How to automatically delete the empty line before the left brace? I always manully delete this empty line.
How to automatically delete thit line?
How to automatically delete thit line?
Here is my ....
1
vote
1
answer
78
views
Why do I get a "for declaration does not refer into a class, class template or class template partial specialization" on Clang and not GCC [duplicate]
I currently have this block of code which does not throw a compiler error on GCC, but throws this compiler error on clang:
error: nested name specifier 'MyEnum::' for declaration does not refer into ...
1
vote
0
answers
69
views
Why is Clang rejecting this coroutine code?
Here's the code:
#include <generator>
std::generator<int> foo() {
int i{};
while (true) {
co_yield i++;
}
}
Clang 18.1.8 rejects it with
/usr/bin/../lib64/gcc/x86_64-...
-1
votes
0
answers
59
views
why my LLDB Debugger is not working even though everythign is correct
I'm a simply a DSA solving student. and since Clion hog lots of RAM. I shifted to VSCode and I'm more intrested in Clang instead of gcc or g++ due to its fast compilation and better diagonstic ability ...