public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45378]  New: Narrowing error not detected
@ 2010-08-22 13:39 saurabh dot manchanda at yahoo dot co dot in
  2010-08-25 10:59 ` [Bug c++/45378] " pinskia at gcc dot gnu dot org
  2010-08-25 11:35 ` [Bug c++/45378] [C++0x] " redi at gcc dot gnu dot org
  0 siblings, 2 replies; 6+ messages in thread
From: saurabh dot manchanda at yahoo dot co dot in @ 2010-08-22 13:39 UTC (permalink / raw)
  To: gcc-bugs

The following code

int main()
{
   int x { 22.2 };
}

includes an initialization which requires narrowing, but the code compiles fine
without any error/warning.


-- 
           Summary: Narrowing error not detected
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: saurabh dot manchanda at yahoo dot co dot in


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


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

* [Bug c++/45378] Narrowing error not detected
  2010-08-22 13:39 [Bug c++/45378] New: Narrowing error not detected saurabh dot manchanda at yahoo dot co dot in
@ 2010-08-25 10:59 ` pinskia at gcc dot gnu dot org
  2010-08-25 11:35 ` [Bug c++/45378] [C++0x] " redi at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-08-25 10:59 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 259 bytes --]



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-08-25 10:59 -------
With -Wconversion, I get:

t.cc:3:17: warning: conversion to ‘int’ alters ‘double’ constant value
[-Wconversion]


-- 


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


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

* [Bug c++/45378] [C++0x] Narrowing error not detected
  2010-08-22 13:39 [Bug c++/45378] New: Narrowing error not detected saurabh dot manchanda at yahoo dot co dot in
  2010-08-25 10:59 ` [Bug c++/45378] " pinskia at gcc dot gnu dot org
@ 2010-08-25 11:35 ` redi at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-25 11:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2010-08-25 11:35:41
               date|                            |
            Summary|Narrowing error not detected|[C++0x] Narrowing error not
                   |                            |detected


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


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

* [Bug c++/45378] [C++0x] Narrowing error not detected
       [not found] <bug-45378-4@http.gcc.gnu.org/bugzilla/>
  2011-06-15 18:27 ` jason at gcc dot gnu.org
  2011-06-16 22:13 ` jason at gcc dot gnu.org
@ 2011-06-17  0:09 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-17  0:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-17 00:09:18 UTC ---
Fixed for 4.7.0.


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

* [Bug c++/45378] [C++0x] Narrowing error not detected
       [not found] <bug-45378-4@http.gcc.gnu.org/bugzilla/>
  2011-06-15 18:27 ` jason at gcc dot gnu.org
@ 2011-06-16 22:13 ` jason at gcc dot gnu.org
  2011-06-17  0:09 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-16 22:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-16 22:09:25 UTC ---
Author: jason
Date: Thu Jun 16 22:09:20 2011
New Revision: 175122

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175122
Log:
    PR c++/45378
    * decl.c (check_initializer): Check narrowing.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist52.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/45378] [C++0x] Narrowing error not detected
       [not found] <bug-45378-4@http.gcc.gnu.org/bugzilla/>
@ 2011-06-15 18:27 ` jason at gcc dot gnu.org
  2011-06-16 22:13 ` jason at gcc dot gnu.org
  2011-06-17  0:09 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-15 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

end of thread, other threads:[~2011-06-17  0:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-22 13:39 [Bug c++/45378] New: Narrowing error not detected saurabh dot manchanda at yahoo dot co dot in
2010-08-25 10:59 ` [Bug c++/45378] " pinskia at gcc dot gnu dot org
2010-08-25 11:35 ` [Bug c++/45378] [C++0x] " redi at gcc dot gnu dot org
     [not found] <bug-45378-4@http.gcc.gnu.org/bugzilla/>
2011-06-15 18:27 ` jason at gcc dot gnu.org
2011-06-16 22:13 ` jason at gcc dot gnu.org
2011-06-17  0:09 ` jason 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).