public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58986] New: [C++11] Narrowing for initializer lists must be an error
@ 2013-11-04 14:22 thomas.braun@virtuell-zuhause.de
  2013-11-04 14:49 ` [Bug c++/58986] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: thomas.braun@virtuell-zuhause.de @ 2013-11-04 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58986
           Summary: [C++11] Narrowing for initializer lists must be an
                    error
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thomas.braun@virtuell-zuhause.de

Compiling
#########
struct B {
  B(int, double) {}
};

void g(B) {};
int main(int argc, char** argv)
{
  g( {'a', 'b'} ); // OK: g(B(int,double)) user-defined conversion
  g( {1.0, 1.0} ); // error: narrowing
}
#########
with LANG=C g++ -std=c++11 gcc-bug-narrowing.cpp

with g++ 4.8.2 compiles fine with the warning:
#########
gcc-bug-narrowing.cpp: In function 'int main(int, char**)':
gcc-bug-narrowing.cpp:9:17: warning: narrowing conversion of '1.0e+0' from
'double' to 'int' inside { } [-Wnarrowing]
   g( {1.0, 1.0} ); // error: narrowing
#########

Although C++11 standard §13.3.3.1.5 3 states that narrowing for initializer
lists is an error.
>From gcc-bugs-return-433450-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 04 14:25:39 2013
Return-Path: <gcc-bugs-return-433450-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23790 invoked by alias); 4 Nov 2013 14:25:39 -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 21837 invoked by uid 48); 4 Nov 2013 14:23:37 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58982] [4.9 Regression] std::vector<std::atomic<int>> vai(10); does not compile anymore
Date: Mon, 04 Nov 2013 14:25: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: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: redi at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone
Message-ID: <bug-58982-4-VQo15CsdlB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58982-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58982-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-11/txt/msg00227.txt.bz2
Content-length: 293

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug c++/58986] [C++11] Narrowing for initializer lists must be an error
  2013-11-04 14:22 [Bug c++/58986] New: [C++11] Narrowing for initializer lists must be an error thomas.braun@virtuell-zuhause.de
@ 2013-11-04 14:49 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-04 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup.

*** This bug has been marked as a duplicate of bug 55783 ***


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

end of thread, other threads:[~2013-11-04 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-04 14:22 [Bug c++/58986] New: [C++11] Narrowing for initializer lists must be an error thomas.braun@virtuell-zuhause.de
2013-11-04 14:49 ` [Bug c++/58986] " 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).