public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/81642] -Wtype-limits should not trigger for defined numbers
       [not found] <bug-81642-4@http.gcc.gnu.org/bugzilla/>
@ 2021-01-18  1:43 ` ryan_greenblatt at brown dot edu
  2021-01-18  1:44 ` ryan_greenblatt at brown dot edu
  1 sibling, 0 replies; 2+ messages in thread
From: ryan_greenblatt at brown dot edu @ 2021-01-18  1:43 UTC (permalink / raw)
  To: gcc-bugs

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

Ryan Greenblatt <ryan_greenblatt at brown dot edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ryan_greenblatt at brown dot edu

--- Comment #4 from Ryan Greenblatt <ryan_greenblatt at brown dot edu> ---
This occurs for c++ templates/constexpr as well. For example:
```
#include <cstdint>
#include <limits>

template <unsigned n>
constexpr bool bigger_than_max = n > std::numeric_limits<uint8_t>::max();

static_assert(!bigger_than_max<0>);
static_assert(bigger_than_max<256>);

```
https://godbolt.org/z/5fG4vE

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

* [Bug c++/81642] -Wtype-limits should not trigger for defined numbers
       [not found] <bug-81642-4@http.gcc.gnu.org/bugzilla/>
  2021-01-18  1:43 ` [Bug c++/81642] -Wtype-limits should not trigger for defined numbers ryan_greenblatt at brown dot edu
@ 2021-01-18  1:44 ` ryan_greenblatt at brown dot edu
  1 sibling, 0 replies; 2+ messages in thread
From: ryan_greenblatt at brown dot edu @ 2021-01-18  1:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Ryan Greenblatt <ryan_greenblatt at brown dot edu> ---
(In reply to Ryan Greenblatt from comment #4)
> This occurs for c++ templates/constexpr as well. For example:
> ```
> #include <cstdint>
> #include <limits>
> 
> template <unsigned n>
> constexpr bool bigger_than_max = n > std::numeric_limits<uint8_t>::max();
> 
> static_assert(!bigger_than_max<0>);
> static_assert(bigger_than_max<256>);
> 
> ```
> https://godbolt.org/z/5fG4vE

Oops, actually this doesn't happen on trunk - look like it was fixed recently.

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

end of thread, other threads:[~2021-01-18  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-81642-4@http.gcc.gnu.org/bugzilla/>
2021-01-18  1:43 ` [Bug c++/81642] -Wtype-limits should not trigger for defined numbers ryan_greenblatt at brown dot edu
2021-01-18  1:44 ` ryan_greenblatt at brown dot edu

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