public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
@ 2021-03-26 16:53 nok.raven at gmail dot com
  2021-03-26 17:44 ` [Bug c++/99795] " mpolacek at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: nok.raven at gmail dot com @ 2021-03-26 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99795
           Summary: -Wnarrowing/-Woverflow false-negative in constant
                    expression in undeduced context
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nok.raven at gmail dot com
                CC: jason at redhat dot com, mpolacek at gcc dot gnu.org
  Target Milestone: ---

template <char N> struct X {};
template <class T> X<sizeof(T)> foo();
int x = sizeof(foo<char[512]>());

template <typename T>
struct bar { typedef X<sizeof(T)> t; };
bar<char[512]> y;


GCC 4.6-6 had an -Woverflow warning here; since GCC 7 -Wconversion warning was
emitted instead, but since bug 99331 is fixed there is no warning at all.

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

* [Bug c++/99795] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
@ 2021-03-26 17:44 ` mpolacek at gcc dot gnu.org
  2021-03-26 17:45 ` [Bug c++/99795] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-26 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-03-26
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, thanks for opening.

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

* [Bug c++/99795] [8/9/10/11 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
  2021-03-26 17:44 ` [Bug c++/99795] " mpolacek at gcc dot gnu.org
@ 2021-03-26 17:45 ` mpolacek at gcc dot gnu.org
  2021-04-05 21:57 ` jason at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-26 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |8.5
            Summary|-Wnarrowing/-Woverflow      |[8/9/10/11 Regression]
                   |false-negative in constant  |-Wnarrowing/-Woverflow
                   |expression in undeduced     |false-negative in constant
                   |context                     |expression in undeduced
                   |                            |context

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

* [Bug c++/99795] [8/9/10/11 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
  2021-03-26 17:44 ` [Bug c++/99795] " mpolacek at gcc dot gnu.org
  2021-03-26 17:45 ` [Bug c++/99795] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
@ 2021-04-05 21:57 ` jason at gcc dot gnu.org
  2021-04-07 17:10 ` jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-05 21:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/99795] [8/9/10/11 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (2 preceding siblings ...)
  2021-04-05 21:57 ` jason at gcc dot gnu.org
@ 2021-04-07 17:10 ` jason at gcc dot gnu.org
  2021-04-07 17:10 ` jason at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-07 17:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Created attachment 50524
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50524&action=edit
WIP Fix

This patch uses IMPLICIT_CONV_EXPR to get the narrowing error, but more and
more changes are being necessary to prevent regressions; this isn't going to be
safe for GCC 11 at this point, so I'm going to put it aside for now.

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

* [Bug c++/99795] [8/9/10/11 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (3 preceding siblings ...)
  2021-04-07 17:10 ` jason at gcc dot gnu.org
@ 2021-04-07 17:10 ` jason at gcc dot gnu.org
  2021-04-08 13:14 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-07 17:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/99795] [8/9/10/11 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (4 preceding siblings ...)
  2021-04-07 17:10 ` jason at gcc dot gnu.org
@ 2021-04-08 13:14 ` rguenth at gcc dot gnu.org
  2021-05-14  9:54 ` [Bug c++/99795] [9/10/11/12 " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/99795] [9/10/11/12 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (5 preceding siblings ...)
  2021-04-08 13:14 ` rguenth at gcc dot gnu.org
@ 2021-05-14  9:54 ` jakub at gcc dot gnu.org
  2021-06-01  8:20 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug c++/99795] [9/10/11/12 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (6 preceding siblings ...)
  2021-05-14  9:54 ` [Bug c++/99795] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-06-01  8:20 ` rguenth at gcc dot gnu.org
  2022-05-27  9:44 ` [Bug c++/99795] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug c++/99795] [10/11/12/13 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (7 preceding siblings ...)
  2021-06-01  8:20 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:44 ` rguenth at gcc dot gnu.org
  2022-06-28 10:44 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug c++/99795] [10/11/12/13 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (8 preceding siblings ...)
  2022-05-27  9:44 ` [Bug c++/99795] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:44 ` jakub at gcc dot gnu.org
  2023-07-07 10:39 ` [Bug c++/99795] [11/12/13/14 " rguenth at gcc dot gnu.org
  2024-03-11  2:54 ` [Bug c++/99795] [11/12 " law at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug c++/99795] [11/12/13/14 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (9 preceding siblings ...)
  2022-06-28 10:44 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:39 ` rguenth at gcc dot gnu.org
  2024-03-11  2:54 ` [Bug c++/99795] [11/12 " law at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug c++/99795] [11/12 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context
  2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
                   ` (10 preceding siblings ...)
  2023-07-07 10:39 ` [Bug c++/99795] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-03-11  2:54 ` law at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-11  2:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12/13/14 Regression]    |[11/12 Regression]
                   |-Wnarrowing/-Woverflow      |-Wnarrowing/-Woverflow
                   |false-negative in constant  |false-negative in constant
                   |expression in undeduced     |expression in undeduced
                   |context                     |context
                 CC|                            |law at gcc dot gnu.org

--- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Works with gcc-13 and the trunk. Adjusting regression markers.

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

end of thread, other threads:[~2024-03-11  2:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 16:53 [Bug c++/99795] New: -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context nok.raven at gmail dot com
2021-03-26 17:44 ` [Bug c++/99795] " mpolacek at gcc dot gnu.org
2021-03-26 17:45 ` [Bug c++/99795] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
2021-04-05 21:57 ` jason at gcc dot gnu.org
2021-04-07 17:10 ` jason at gcc dot gnu.org
2021-04-07 17:10 ` jason at gcc dot gnu.org
2021-04-08 13:14 ` rguenth at gcc dot gnu.org
2021-05-14  9:54 ` [Bug c++/99795] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:20 ` rguenth at gcc dot gnu.org
2022-05-27  9:44 ` [Bug c++/99795] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:44 ` jakub at gcc dot gnu.org
2023-07-07 10:39 ` [Bug c++/99795] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-11  2:54 ` [Bug c++/99795] [11/12 " law 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).