public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94186] New: compiler incorrectly accepts a requires clause with predicate of non-bool type
@ 2020-03-15 22:43 akrzemi1 at gmail dot com
  2020-03-16 10:53 ` [Bug c++/94186] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: akrzemi1 at gmail dot com @ 2020-03-15 22:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94186
           Summary: compiler incorrectly accepts a requires clause with
                    predicate of non-bool type
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: akrzemi1 at gmail dot com
  Target Milestone: ---

The following program should fail to compile in C++20 because the type of the
predicate in requires-clause is not bool. 

```
template <typename T>
struct is_small
{
  enum { value = sizeof(T) <= 4 };
};

template <typename T>
  requires is_small<T>::value
void fun(T) {} 

template <typename T>
void fun(T) {} 

int main()
{
  fun(1);  // expected hard compiler error
}
```

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

end of thread, other threads:[~2020-03-24 22:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15 22:43 [Bug c++/94186] New: compiler incorrectly accepts a requires clause with predicate of non-bool type akrzemi1 at gmail dot com
2020-03-16 10:53 ` [Bug c++/94186] " marxin at gcc dot gnu.org
2020-03-17  4:10 ` [Bug c++/94186] [10 Regression] " jason at gcc dot gnu.org
2020-03-17 10:58 ` paolo.carlini at oracle dot com
2020-03-17 14:16 ` paolo.carlini at oracle dot com
2020-03-20  4:13 ` jason at gcc dot gnu.org
2020-03-20 11:46 ` rguenth at gcc dot gnu.org
2020-03-24 22:25 ` cvs-commit at gcc dot gnu.org
2020-03-24 22:26 ` 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).