public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95132] New: Concept checked after auto return type deduction
@ 2020-05-14 13:50 bluescarni at gmail dot com
  2020-05-14 15:26 ` [Bug c++/95132] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bluescarni at gmail dot com @ 2020-05-14 13:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95132
           Summary: Concept checked after auto return type deduction
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bluescarni at gmail dot com
  Target Milestone: ---

It seems like in GCC's implementation of C++20 concepts, concept checking is
done after the instantiation of the body of a function with auto return type
deduction.

See the godbolt link, where the same snippet of code is being compiled with
GCC, clang and MSVC:

https://godbolt.org/z/CMzZyV

As you see, the first GCC error comes from the failure in the instantiation of
the body of function bar(), and only later GCC complains about the concept
check failure. The other two compilers don't produce any error from the
instantiation of bar().

This is problematic because it means that another concept that would check
whether or not bar() can be called with a specific argument type would fail
with a hard compile time error, instead of marking the concept as not
satisfied.

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

end of thread, other threads:[~2020-10-28 21:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 13:50 [Bug c++/95132] New: Concept checked after auto return type deduction bluescarni at gmail dot com
2020-05-14 15:26 ` [Bug c++/95132] " redi at gcc dot gnu.org
2020-05-15 13:57 ` ppalka at gcc dot gnu.org
2020-10-25 19:27 ` ppalka at gcc dot gnu.org
2020-10-28 15:47 ` cvs-commit at gcc dot gnu.org
2020-10-28 21:25 ` cvs-commit at gcc dot gnu.org
2020-10-28 21:34 ` ppalka 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).