public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
@ 2013-02-11 2:54 daniel at constexpr dot org
2013-02-11 7:44 ` [Bug libstdc++/56282] " rguenth at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: daniel at constexpr dot org @ 2013-02-11 2:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
Bug #: 56282
Summary: [4.8 regression] std::basic_ios<char> broken with
-std=c++11 (undefined reference)
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel@constexpr.org
Simple enough:
$ echo -e '#include <iostream>\n int main() { std::cout << "Hello World!\\n";
return bool(std::cout); }' | g++-4.8.0-pre9999 -x c++ - -std=c++11
/tmp/cc4QaOVU.o: In function `main':
:(.text+0x19): undefined reference to `std::basic_ios<char,
std::char_traits<char> >::operator bool() const'
collect2: error: ld returned 1 exit status
Broken by this commit:
http://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9d8eb68081f898e225727d69da8212813f27e199
The offending commit adds the correct test operator for C++11:
+#if __cplusplus >= 201103L
+ explicit operator bool() const
+ { return !this->fail(); }
+#else
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
+#endif
However, std::basic_ios<char> is explicitly instantiated in libstdc++.so (from
basic_ios.tcc):
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ios<char>;
#ifdef _GLIBCXX_USE_WCHAR_T
extern template class basic_ios<wchar_t>;
#endif
#endif
So the gcc doesn't instantiate explicit operator bool for std::basic_ios<char>
and instead tries to use the instantiation in libstdc++.so, which only has the
operator void*.
$ g++-4.8.0-pre9999 -v
Using built-in specs.
COLLECT_GCC=g++-4.8.0-pre9999
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.8.0_pre9999/work/gcc-4.8.0-9999/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0-pre9999
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check
--with-cloog-include=/usr/include/cloog-ppl --enable-lto --enable-nls
--without-included-gettext --with-system-zlib --enable-obsolete
--disable-werror --enable-secureplt --enable-multilib
--with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp
--enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/python
--enable-checking=release --disable-libgcj --enable-libstdcxx-time
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.0_pre9999'
Thread model: posix
gcc version 4.8.0-pre9999 20130211 (experimental) commit
37db34b1d053392f4d8899178a7f647bb70f400e (Gentoo 4.8.0_pre9999)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
@ 2013-02-11 7:44 ` rguenth at gcc dot gnu.org
2013-02-11 9:04 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-11 7:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
2013-02-11 7:44 ` [Bug libstdc++/56282] " rguenth at gcc dot gnu.org
@ 2013-02-11 9:04 ` jakub at gcc dot gnu.org
2013-02-11 9:53 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-11 9:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-02-11
CC| |jakub at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-11 09:04:00 UTC ---
Guess we need a new export and instantiate this operator from some C++11 source
too?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
2013-02-11 7:44 ` [Bug libstdc++/56282] " rguenth at gcc dot gnu.org
2013-02-11 9:04 ` jakub at gcc dot gnu.org
@ 2013-02-11 9:53 ` redi at gcc dot gnu.org
2013-02-11 10:03 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2013-02-11 9:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-02-11 09:53:38 UTC ---
Created attachment 29415
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29415
Instantiate and export new operator
Something like this, although putting it in fstream-inst.cc is a bit of a hack,
it just happens to be compiled as C++11
I'm not sure the wildcard patterns are right yet though...
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
` (2 preceding siblings ...)
2013-02-11 9:53 ` redi at gcc dot gnu.org
@ 2013-02-11 10:03 ` redi at gcc dot gnu.org
2013-02-11 10:09 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2013-02-11 10:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #29415|0 |1
is obsolete| |
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-02-11 10:03:31 UTC ---
Created attachment 29416
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29416
fix exports
I think this is right now
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
` (3 preceding siblings ...)
2013-02-11 10:03 ` redi at gcc dot gnu.org
@ 2013-02-11 10:09 ` paolo.carlini at oracle dot com
2013-02-11 10:31 ` paolo at gcc dot gnu.org
2013-02-11 10:33 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-11 10:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-11 10:09:05 UTC ---
Nahh, let's revert the whole thing.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
` (4 preceding siblings ...)
2013-02-11 10:09 ` paolo.carlini at oracle dot com
@ 2013-02-11 10:31 ` paolo at gcc dot gnu.org
2013-02-11 10:33 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2013-02-11 10:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
--- Comment #5 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2013-02-11 10:30:50 UTC ---
Author: paolo
Date: Mon Feb 11 10:30:43 2013
New Revision: 195939
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195939
Log:
2013-02-11 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/56282
Revert:
2013-02-06 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/56193
* include/bits/basic_ios.h: Replace operator void*() const
with explicit operator bool() const in C++11 and greater.
* testsuite/27_io/basic_ios/pr56193.cc: New file.
Removed:
trunk/libstdc++-v3/testsuite/27_io/basic_ios/pr56193.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/basic_ios.h
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/56282] [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference)
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
` (5 preceding siblings ...)
2013-02-11 10:31 ` paolo at gcc dot gnu.org
@ 2013-02-11 10:33 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-11 10:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56282
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-11 10:32:55 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-02-11 10:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-11 2:54 [Bug libstdc++/56282] New: [4.8 regression] std::basic_ios<char> broken with -std=c++11 (undefined reference) daniel at constexpr dot org
2013-02-11 7:44 ` [Bug libstdc++/56282] " rguenth at gcc dot gnu.org
2013-02-11 9:04 ` jakub at gcc dot gnu.org
2013-02-11 9:53 ` redi at gcc dot gnu.org
2013-02-11 10:03 ` redi at gcc dot gnu.org
2013-02-11 10:09 ` paolo.carlini at oracle dot com
2013-02-11 10:31 ` paolo at gcc dot gnu.org
2013-02-11 10:33 ` paolo.carlini at oracle dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).