public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94922] New: Functional cast from base class to derived class incorrectly accepted with -std=c++2a
@ 2020-05-02 12:53 ppalka at gcc dot gnu.org
  2020-05-02 12:57 ` [Bug c++/94922] " ppalka at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-05-02 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94922
           Summary: Functional cast from base class to derived class
                    incorrectly accepted with -std=c++2a
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat testcase.C
struct base {};
struct derived : base {};

template <typename T, typename R, typename = decltype(T(R()))>
void foo();

void
bar()
{
  foo<derived, base>();
}

$ g++-10 -std=c++2a testcase.C
$ g++-10 -std=c++17 testcase.C
testcase.C: In function ‘void bar()’:
testcase.C:10:22: error: no matching function for call to ‘foo<derived,
base>()’
   13 |   foo<derived, base>();
      |                      ^
...

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

end of thread, other threads:[~2020-05-03  4:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02 12:53 [Bug c++/94922] New: Functional cast from base class to derived class incorrectly accepted with -std=c++2a ppalka at gcc dot gnu.org
2020-05-02 12:57 ` [Bug c++/94922] " ppalka at gcc dot gnu.org
2020-05-02 13:00 ` ppalka at gcc dot gnu.org
2020-05-03  4:31 ` 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).