From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1256 invoked by alias); 15 Jan 2014 08:32:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1223 invoked by uid 48); 15 Jan 2014 08:32:08 -0000 From: "jan.kratochvil at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/59675] -D_GLIBCXX_DEBUG asserts to stdout (it should stderr) Date: Wed, 15 Jan 2014 08:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jan.kratochvil at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg01537.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59675 --- Comment #2 from Jan Kratochvil --- It needs also some new #include as otherwise one may get: In file included from /usr/include/c++/4.8.2/bits/stl_algobase.h:59:0, from /usr/include/c++/4.8.2/list:60, from list.C:1: /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h: In function = =E2=80=98void std::__replacement_assert(const char*, int, const char*, const char*)=E2=80= =99: /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2042:23: error: =E2=80=98stderr=E2=80=99 was not declared in this scope __builtin_fprintf(stderr, "%s:%d: %s: Assertion '%s' failed.\n", __fil= e, ^ >>From gcc-bugs-return-440396-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 08:35:24 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 3159 invoked by alias); 15 Jan 2014 08:35:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 3135 invoked by uid 48); 15 Jan 2014 08:35:20 -0000 From: "joerg.richter@pdv-fs.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59821] New: __builtin_LINE and __builtin_FILE for new'd objects is wrong Date: Wed, 15 Jan 2014 08:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joerg.richter@pdv-fs.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg01538.txt.bz2 Content-length: 850 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59821 Bug ID: 59821 Summary: __builtin_LINE and __builtin_FILE for new'd objects is wrong Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: joerg.richter@pdv-fs.de The script below demonstrates that __builtin_LINE used in constructors is different when the object is allocated with new. The same is true for __builtin_FILE and I suspect also for __builtin_FUNCTION. cat > t.cc < struct Foo { int line; Foo( int line = __builtin_LINE() ) : line( line ) {} }; int main() { assert( Foo().line == (new Foo)->line ); } EOF g++ -o t t.cc ./t