public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97704] New: [11 Regression][concepts] Not working with explicit types in function signatures?
@ 2020-11-03 16:13 gcc-bugs at marehr dot dialup.fu-berlin.de
  2020-11-03 19:12 ` [Bug c++/97704] " gcc-bugs at marehr dot dialup.fu-berlin.de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc-bugs at marehr dot dialup.fu-berlin.de @ 2020-11-03 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97704
           Summary: [11 Regression][concepts] Not working with explicit
                    types in function signatures?
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de
  Target Milestone: ---

Hi gcc-team,

consider the following program:

```c++
struct non_exisiting {};

template <typename t>
auto hard_error(t in)
{
    static_assert(in, "Failure");
    return;
}

template <typename t>
    requires requires { hard_error(t{}); }
constexpr auto foo(t, non_exisiting);

template <typename t>
constexpr auto foo(t, bool) { return false; };

int main()
{
    foo(0, false);
};
```

This worked since at least g++-7 up until g++-10.2, works with clang (11 and
trunk), as well as msvc.

I would expect that `foo(t, non_exisiting)` will not be considered, because it
would not be meaningful in this case (`bool` is not of type `non_exisiting` and
there is no conversion sequence from `bool` to `non_exisiting`).

See https://godbolt.org/z/3W5eG8

I hope this is a bug and not intended behaviour, because I encountered this
problem by using a range adaptor from the stdlib inside a templated class which
all of a sudden found `operator|` (a hidden friend of that range adaptor) by
ADL even though that operator did not match signature-wise.

If this is intended behaviour, what in world is the type of the second
parameter of `foo(t, non_exisiting)`?

Thank you!

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

end of thread, other threads:[~2020-12-22 19:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 16:13 [Bug c++/97704] New: [11 Regression][concepts] Not working with explicit types in function signatures? gcc-bugs at marehr dot dialup.fu-berlin.de
2020-11-03 19:12 ` [Bug c++/97704] " gcc-bugs at marehr dot dialup.fu-berlin.de
2020-11-04  8:08 ` rguenth at gcc dot gnu.org
2020-11-19 18:07 ` mpolacek at gcc dot gnu.org
2020-11-19 18:07 ` mpolacek at gcc dot gnu.org
2020-12-17 23:43 ` gcc-bugs at marehr dot dialup.fu-berlin.de
2020-12-22 19:37 ` 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).