Bug 702256 - clang++ gives many errors when the c++ standard library is used
clang++ gives many errors when the c++ standard library is used
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: llvm (Show other bugs)
15
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Michel Alexandre Salim
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-05 03:52 EDT by Joonas Sarajärvi
Modified: 2011-11-14 03:16 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-01 17:59:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
output from running the compiler on a simple program (3.80 KB, text/plain)
2011-05-05 03:57 EDT, Joonas Sarajärvi
no flags Details

  None (edit)
Description Joonas Sarajärvi 2011-05-05 03:52:06 EDT
Description of problem:
Instead of working as it used to, clang++ fails to compile
anything that includes almost any headers from the C++
standard library. At least these headers have triggered
the problem for me:

iostream
list
string
vector

Headers which do not seem to trigger the problem:
cmath
cstdlib

Version-Release number of selected component (if applicable):
clang-2.8-11.fc15.x86_64

How reproducible:
Easily by trying to compile a sample program that
#includes something from the C++ standard library.

Steps to Reproduce:
1. Write a program.cpp where you #include <vector>
   or some other common header from the standard
   library.
2. clang++ -c program.cpp

Actual results:
Lots of errors, sample output should be in the attachments.

Expected results:
Succesfully compiled program.o file in current working directory.

Additional info:
Found some discussion probably relevant to the bug here:
http://www.mail-archive.com/llvmbugs@cs.uiuc.edu/msg12529.html
Comment 1 Joonas Sarajärvi 2011-05-05 03:57:44 EDT
Created attachment 497005 [details]
output from running the compiler on a simple program
Comment 2 Jonathan Wakely 2011-06-10 15:40:06 EDT
Clang 2.8 can't handle the GNU extensions we use in recent versions of libstdc++, I think 3.0 fares a little better, but for clang++ to be at all useful Fedora needs to ship an old set of libstdc++ headers for Clang to use (or ship libc++ but I don't know if that is usable on GNU/Linux)

It would be good to upgrade to Clang 3.0 anyway, it has a number of bugfixes for C++ and at least one new warning that's found a real bug for me
Comment 3 Michel Alexandre Salim 2011-08-01 17:59:58 EDT
Unfortunately we can't update the LLVM/clang stack on existing Fedora versions -- LLVM is used by some key components (e.g. mesa). Fedora 16 will get clang 2.9.
Comment 4 Jonathan Wakely 2011-08-04 16:38:19 EDT
Upgrading to 3.0 was only a suggestion, but IIUC would still not allow clang++ to use the libstdc++ 4.6 headers shipped with Fedora, which is what this bug is actually about.

Does clang 2.9 work for trivial C++ code? If not, what about using an alternative set of libstdc++ headers from an older GCC?
Comment 5 Joonas Sarajärvi 2011-11-14 03:16:19 EST
clang-3.0-0.1.rc3.fc17.i686 in current Rawhide seems to work much just fine when used with libstdc++. Hopefully Fedora 17 will end up with a working combination of clang and libstdc++.

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