Bug 1190329 - [gcc] compilation of simple C++ program with clang++ fails after upgrading to GCC 5.0.0
Summary: [gcc] compilation of simple C++ program with clang++ fails after upgrading to...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 22
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-07 08:54 UTC by Joachim Frieben
Modified: 2015-03-07 19:59 UTC (History)
10 users (show)

Fixed In Version: gcc-5.0.0-0.18.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-07 19:59:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Sample C++ program for which compilation with clang++ fails (557 bytes, text/x-csrc)
2015-02-07 08:54 UTC, Joachim Frieben
no flags Details

Description Joachim Frieben 2015-02-07 08:54:49 UTC
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).

Comment 1 Dave Johansen 2015-02-26 15:17:58 UTC
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;

Comment 2 Joachim Frieben 2015-02-27 14:57:55 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.