public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/58764] New: error: converting to ‘const std::vector<std::basic_string<char> >’ from initializer list would use explicit constructor
@ 2013-10-17  8:04 markus at trippelsdorf dot de
  2013-10-17  9:01 ` [Bug libstdc++/58764] [lwg/2193] " paolo.carlini at oracle dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: markus at trippelsdorf dot de @ 2013-10-17  8:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58764

            Bug ID: 58764
           Summary: error: converting to ‘const
                    std::vector<std::basic_string<char> >’ from
                    initializer list would use explicit constructor
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markus at trippelsdorf dot de

aria2 fails to compile with gcc-4.8:

download_helper.cc: In member function ‘void
aria2::{anonymous}::AccRequestGroup::operator()(const string&)’:
download_helper.cc:373:64: error: converting to ‘const
std::vector<std::basic_string<char> >’ from initializer list would use explicit
constructor ‘std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp
= std::basic_string<char>; _Alloc = std::allocator<std::basic_string<char> >;
std::vector<_Tp, _Alloc>::allocator_type =
std::allocator<std::basic_string<char> >]’
           (createBtRequestGroup(uri, option_, {}, torrent.get()));
                                                                ^

Reduced:

markus@x4 tmp % cat test.cpp
#include <vector>
#include <string>

void foo (const std::vector<std::string>& test)
{
}
void bar ()
{
  foo ({});
}

markus@x4 tmp % g++ -std=c++11 -c test.cpp
test.cpp: In function ‘void bar()’:
test.cpp:9:10: error: converting to ‘const std::vector<std::basic_string<char>
>’ from initializer list would use explicit constructor ‘std::vector<_Tp,
_Alloc>::vector(const allocator_type&) [with _Tp = std::basic_string<char>;
_Alloc = std::allocator<std::basic_string<char> >; std::vector<_Tp,
_Alloc>::allocator_type = std::allocator<std::basic_string<char> >]’
   foo ({});
          ^

markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1/g++ -std=c++11 -c
test.cpp
markus@x4 tmp % clang++ -stdlib=libc++ -std=c++11 -c test.cpp
markus@x4 tmp %
>From gcc-bugs-return-432033-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 17 08:14:31 2013
Return-Path: <gcc-bugs-return-432033-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10489 invoked by alias); 17 Oct 2013 08:14:30 -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 10429 invoked by uid 55); 17 Oct 2013 08:14:27 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/58267] Alignment specifier allowed within array declarator;
Date: Thu, 17 Oct 2013 08:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58267-4-D7aiLryJeR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58267-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58267-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: 2013-10/txt/msg01177.txt.bz2
Content-length: 962

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX267

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Thu Oct 17 08:14:23 2013
New Revision: 203742

URL: http://gcc.gnu.org/viewcvs?rev 3742&root=gcc&view=rev
Log:
    PR c/58267
c/
    * c-parser.c (c_parser_declspecs): Add alignspec_ok parameter.
    Document syntax of the array-declarator.
    (c_parser_declspecs) <RID_ALIGNAS>: Bail out if alignment specs
    are not permitted.
    (c_parser_declaration_or_fndef): Adjust c_parser_declspecs call.
    (c_parser_struct_declaration): Likewise.
    (c_parser_declarator): Likewise.
    (c_parser_direct_declarator_inner): Likewise.
    (c_parser_parameter_declaration): Likewise.
    (c_parser_type_name): Likewise.
testsuite/
    * gcc.dg/c1x-align-5.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/c1x-align-5.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-parser.c
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2014-01-23 10:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-17  8:04 [Bug libstdc++/58764] New: error: converting to ‘const std::vector<std::basic_string<char> >’ from initializer list would use explicit constructor markus at trippelsdorf dot de
2013-10-17  9:01 ` [Bug libstdc++/58764] [lwg/2193] " paolo.carlini at oracle dot com
2013-10-17 10:24 ` glisse at gcc dot gnu.org
2013-10-17 10:46 ` paolo.carlini at oracle dot com
2013-10-17 11:46 ` glisse at gcc dot gnu.org
2013-10-17 13:01 ` paolo.carlini at oracle dot com
2013-10-30 13:30 ` redi at gcc dot gnu.org
2014-01-07 11:53 ` [Bug libstdc++/58764] [4.9 Regression] " rguenth at gcc dot gnu.org
2014-01-09 12:55 ` redi at gcc dot gnu.org
2014-01-22 19:47 ` redi at gcc dot gnu.org
2014-01-22 23:51 ` redi at gcc dot gnu.org
2014-01-22 23:57 ` redi at gcc dot gnu.org
2014-01-23 10:40 ` glisse at gcc dot gnu.org
2014-01-23 10:44 ` 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).