[LLVMbugs] [Bug 8187] New: PCH with C++ headers stop compilation
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Sep 19 10:06:42 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=8187
Summary: PCH with C++ headers stop compilation
Product: clang
Version: 2.8
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: muravev at yandex.ru
CC: llvmbugs at cs.uiuc.edu, muravev at yandex.ru
Created an attachment (id=5508)
--> (http://llvm.org/bugs/attachment.cgi?id=5508)
Preprocessed test.cpp
How to reproduce:
$ cat src/test.h
#include <sstream>
$ cat src/test.cpp
#include <test.h>
int main()
{
std::stringstream strm;
return 0;
}
$ clang++ -x c++-header -Isrc -o build/test.h.pch src/test.h
$ clang++ -c -Isrc -o build/test.o src/test.cpp <---- no errors
$ clang++ -c -Isrc -include build/test.h -o build/test.o src/test.cpp
In file included from
/home/ilya/opt/programming/atom-project/Temp/pch/src/test.h:1:
In file included from /usr/include/c++/4.4/sstream:38:
In file included from /usr/include/c++/4.4/istream:39:
In file included from /usr/include/c++/4.4/ios:42:
In file included from /usr/include/c++/4.4/bits/ios_base.h:42:
In file included from /usr/include/c++/4.4/bits/locale_classes.h:41:
In file included from /usr/include/c++/4.4/string:52:
/usr/include/c++/4.4/bits/basic_string.h:417:7: error: constructor for
'std::basic_string<char>' must explicitly initialize the member
'_M_dataplus' which does not
have a default constructor
basic_string();
^
In file included from
/home/ilya/opt/programming/atom-project/Temp/pch/src/test.h:1:
/usr/include/c++/4.4/sstream:91:7: note: in instantiation of member
function 'std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string'
requested here
basic_stringbuf(ios_base::openmode __mode = ios_base::in |
ios_base::out)
^
/usr/include/c++/4.4/sstream:509:7: note: in instantiation of member
function 'std::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char>
>::basic_stringbuf' requested here
basic_stringstream(ios_base::openmode __m = ios_base::out |
ios_base::in)
^
src/test.cpp:5:23: note: in instantiation of member function
'std::basic_stringstream<char, std::char_traits<char>,
std::allocator<char> >::basic_stringstream'
requested here
std::stringstream strm;
^
In file included from
/home/ilya/opt/programming/atom-project/Temp/pch/src/test.h:1:
In file included from /usr/include/c++/4.4/sstream:38:
In file included from /usr/include/c++/4.4/istream:39:
In file included from /usr/include/c++/4.4/ios:42:
In file included from /usr/include/c++/4.4/bits/ios_base.h:42:
In file included from /usr/include/c++/4.4/bits/locale_classes.h:41:
In file included from /usr/include/c++/4.4/string:52:
/usr/include/c++/4.4/bits/basic_string.h:268:28: note: member is
declared here
mutable _Alloc_hider _M_dataplus;
^
/usr/include/c++/4.4/bits/basic_string.h:251:14: note:
'std::basic_string<char, std::char_traits<char>, std::allocator<char>
> >::_Alloc_hider' declared here
struct _Alloc_hider : _Alloc
^
1 error generated.
############### end of console output
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list