Created attachment 989139 [details] Sample C++ program for which compilation with clang++ fails Description of problem: After upgrading to GCC 5.0, compilation of a simple C++ program fails with clang++ whereas it compiled flawlessly for GCC 4.9.2. Version-Release number of selected component (if applicable): llvm-3.5.0-6.fc22 How reproducible: Always. Steps to Reproduce: 1. Execute 'clang++ -o main pointCpointo.C' Actual results: In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/5.0.0/../../../../include/c++/5.0.0/bits/ios_base.h:44: /usr/bin/../lib/gcc/x86_64-redhat-linux/5.0.0/../../../../include/c++/5.0.0/stdexcept:83:28: error: invalid use of non-static data member '_M_s' char _M_bytes[sizeof(_M_s)]; ^~~~ 1 error generated. Expected results: Compilation completes successfully. Additional info: Execution of 'c++ -o main pointCpointo.C' completes flawlessly with c++ (GCC) 5.0.0 20150206 (Red Hat 5.0.0-0.8).
This is a variation of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64367 and needs the following patch: diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept index bf3e618..2428919 100644 --- a/libstdc++-v3/include/std/stdexcept +++ b/libstdc++-v3/include/std/stdexcept @@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION union { __str _M_s; - char _M_bytes[sizeof(_M_s)]; + char _M_bytes[sizeof(__str)]; }; __sso_string() _GLIBCXX_USE_NOEXCEPT;
Issue applies to llvm-3.5.0-9.fc22, too. The current GCC C++ compiler package is gcc-c++-5.0.0-0.15.fc22.