public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/61658] New: Invalid std::string(size_type, value_type) constructor implementation
@ 2014-06-30 12:47 d.v.a at ngs dot ru
  2014-06-30 13:38 ` [Bug libstdc++/61658] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: d.v.a at ngs dot ru @ 2014-06-30 12:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61658

            Bug ID: 61658
           Summary: Invalid std::string(size_type, value_type) constructor
                    implementation
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.v.a at ngs dot ru

#include<string>
#include<iostream>

int main()
{
    std::string st{1U, '0'};
    std::cout << st.length() << '\n';
    std::cout << st << '\n';
}

Prints:
2
☺0


Must be:
1
0
>From gcc-bugs-return-455333-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 30 12:54:09 2014
Return-Path: <gcc-bugs-return-455333-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15483 invoked by alias); 30 Jun 2014 12:54:09 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 15449 invoked by uid 48); 30 Jun 2014 12:54:05 -0000
From: "d.v.a at ngs dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/61658] Invalid std::string(size_type, value_type) constructor implementation
Date: Mon, 30 Jun 2014 12:54: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.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: d.v.a at ngs dot ru
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: <bug-61658-4-Mn9owpjYyi@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61658-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61658-4@http.gcc.gnu.org/bugzilla/>
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-06/txt/msg02415.txt.bz2
Content-length: 237

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida658

--- Comment #1 from __vic <d.v.a at ngs dot ru> ---
If replace with:

std::string st(1U, '0');

then prints as expected:
1
0

Why {1U, '0'} is treated as std::initializer_list<char> ?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libstdc++/61658] Invalid std::string(size_type, value_type) constructor implementation
  2014-06-30 12:47 [Bug libstdc++/61658] New: Invalid std::string(size_type, value_type) constructor implementation d.v.a at ngs dot ru
@ 2014-06-30 13:38 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2014-06-30 13:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61658

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Because the standard says so


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-30 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30 12:47 [Bug libstdc++/61658] New: Invalid std::string(size_type, value_type) constructor implementation d.v.a at ngs dot ru
2014-06-30 13:38 ` [Bug libstdc++/61658] " redi at gcc dot gnu.org

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).