clang++ Questions
1
I have updated XCode(v. 16.0) and made sure the xcode command line tools (xcode-select version 2409) are updated.
I have installed the C/C++ VS Code extension v.1.21.6
My compiler path is set to /u...
Mouser asked 18/9 at 18:23
1
This code compiles on gcc and msvc but not with clang from C++20 on:
#include <type_traits>
class IBase {
protected:
IBase() noexcept = default;
public:
virtual ~IBase() noexcept = defa...
Redfin asked 21/9 at 16:27
5
Solved
I have a comment that ends with backslash. Something like
...
// use \
..
Clang(++) warned me, that this is multi-line comment
warning: multi-line // comment [-Wcomment]
// use \
^
So I t...
Countryfied asked 17/5, 2015 at 11:12
5
Solved
I am working on a C++ project on my Mac running El Capitan and I get this error even after installing openssl with Homebrew:
g++ -Wall -g -std=c++11 -I../libSocket/src -I../libData/src -c src/fssl...
1
According to the thread-sanitizer docs:
ThreadSanitizer uses more real memory than a native run. At the default settings the memory overhead is 5x plus 1Mb per each thread. Settings with 3x (les...
Holey asked 8/1, 2019 at 9:44
1
Q: Is there a way to speed up clang++ STD Library fstreams? (And does anybody know why it is so much slower than g++?)
I am trying to process very large (many GBs) binary data files and was surpri...
Fateful asked 27/7, 2016 at 22:51
1
Solved
Calling member function of an incomplete type compiles in gcc and does not compile in clang and msvc
Here is an example:
struct TestClass {
void testFunction() const {}
static TestClass* ptr_;
constexpr static auto funcPtr = +[](){ ptr_->testFunction(); };
};
TestClass* TestClass::ptr_ = ne...
Osbert asked 29/2 at 9:7
2
I'm trying to wrap a Python lib around a C++ lib and distutils is failing for me on OS X. Here are the relevant lines from my setup.py:
if sys.platform.startswith("darwin"):
extra_compile_args_se...
3
getting this error on flutter run for a linux desktop application
Running "flutter pub get" in proj... 5.3s
Launching lib/main.dart on Linux in debug mode...
CMake Error at /usr/share/cma...
Cockroach asked 23/11, 2022 at 8:25
3
Pretty much what the title says, i need a way to shift/shuffle the positions of all elements in a 256-avx-register register by N places. all i have found about this uses 32 or 64 bit values (__buil...
7
Solved
I wrote the following simple C++ program:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World" << endl;
return 0;
}
When I compile this with g++, it...
6
Solved
I was trying to play around with the new parallel library features proposed in the C++17 standard, but I couldn't get it to work. I tried compiling with the up-to-date versions of g++ 8.1.1 and cla...
Pruett asked 25/6, 2018 at 20:3
1
Solved
I have the following code
#include <iostream>
void foo(const int* const &i_p) {
std::cout << &i_p << std::endl;
}
int main () {
int i = 10;
int* i_p = &i;
std::...
Sartin asked 15/9, 2023 at 17:30
1
Solved
I have a template class with a private constructor which is to be friends of every typed instance of the class. The following compiles under g++ 11.4.0 but fails under clang++ version 14.0.0-1ubunt...
4
Solved
UPDATE:
I've written a detailed tutorial that incorporates the top two answers on this question: http://blog.johannesmp.com/2015/09/01/installing-clang-on-windows-pt1/
TL;DR
On Windows, Given the...
Crissie asked 27/8, 2015 at 1:11
2
Solved
I want to use std::span as a template template argument to a function.
gcc seems to accept the following code, but clang rejects.
#include <iostream>
#include <span>
#include <vector...
2
Solved
I'm using the following program:
In the main function, I want to print the address of the poll_timer function.
The program compiles and runs successfully with clang but not with GCC.
I get the foll...
Hypertonic asked 24/5, 2023 at 17:54
1
Solved
Consider the following functions:
static inline float Eps(const float x) {
const float eps = std::numeric_limits<float>::epsilon();
return (1.0f + eps) * x - x;
}
float Eps1() {
return Ep...
Jab asked 10/5, 2023 at 3:49
2
Solved
I am unable to build a simple hello world application using clang-6.0 on bionic beaver, the build command fails with below error.
clang++-6.0 -std=c++17 -stdlib=libc++ hello.cc -o hello
/usr/bi...
Boysenberry asked 19/3, 2018 at 4:47
2
What is the purpose of the -Wlifetime compile flag in clang?
The information I found on the Internet about it are very vague. Is this any noticeable feature?
4
(Ubuntu 16.04.1)
By default on 16.04.1 clang is picking the gcc tool chain for 5.4. Unfortunately I have a library that requires pre-5.0 ABI and I do NOT have access to the source, nor has the imp...
2
Solved
I'm trying to set up clang-tidy for a project. I'd like to be able to have clean output, and encourage the use of -fix mode where possible. However, there are individual cases where an exception is...
Ourself asked 21/6, 2016 at 17:1
1
Solved
thread_local int* tls = nullptr;
// using libcontext to jump stack.
void jump_stack();
void* test() {
// before jump_stack, assume we are at thread 1.
int *cur_tls = tls;
jump_stack();
// after...
10
Solved
I've tried to compile simple hello world on Fedora 20 with Clang, and I get the following output:
d.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
I don't have any ide...
Scrutiny asked 13/10, 2014 at 6:2
1
GCC provides a way to optimize a function/section of code selectively with
fast-math using attributes. Is there a way to enable the same in Clang with pragmas/attributes?
I understand Clang provide...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.