Using OpenMP with clang

Some additional comments: 1) You need to use -fopenmp=libomp to enable OpenMP in clang. -fopenmp just links libgomp but ignores all the pragmas. Weird, I know — and will be changed in the trunk soon. 2) 3.7 is the first version that supports OpenMP. 3.6 doesn’t. 3) clang is only able to work with libomp. … Read more

Why does Clang 12 refuse to initialize aggregates in the C++20 way?

This is a C++20 feature that allows aggregate initialization through the standard constructor syntax, rather than the typical braced-list initialization syntax. (Note that this only works if the parameters cannot be used in a valid call to a default or copy/move constructor. If they could, that would be called instead of performing aggregate initialization.) According … Read more

Why can’t I move std::ofstream?

According to the standard 27.9.1.11 basic_ofstream constructors or, its more “readable” version http://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream , std::basic_ostream<> has a move constructor, so the code should compile. clang++ 3.5 compiles it with -std=c++11 or -std=c++1y. Also gcc5 compiles it, so probably it is not implemented in libstdc++ for gcc < 5 Interestingly, the lack of move semantics is … Read more