public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103499] New: C++20 modules error: invalid use of non-static member function
@ 2021-11-30 16:35 oleg at smolsky dot net
  2022-09-02 20:28 ` [Bug c++/103499] " markmigm at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: oleg at smolsky dot net @ 2021-11-30 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103499
           Summary: C++20 modules error: invalid use of non-static member
                    function
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: oleg at smolsky dot net
  Target Milestone: ---

There seems to be a bug when exporting a class hierarchy from a module. Here is
the GCC11 output:

/opt/gcc-11/bin/g++ -std=c++20 -fmodules-ts -c -o main.o main.cpp
main.cpp: In function ‘int main()’:
main.cpp:6:12: error: invalid use of non-static member function ‘virtual
Derived@task::~Derived()’
    6 |     delete p;

$ cat task.cpp
export module task;

#include "b.h"
#include "d.h"

$ cat b.h
#pragma once

export struct Base {
  virtual ~Base() = default;

  void DoStuff();
};

$ cat d.h
#include "b.h"

export struct Derived : Base {
  ~Derived();
};

$ cat main.cpp
import task;

int main() {
    auto p = new Derived;
    p->DoStuff();
    delete p;
}

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

end of thread, other threads:[~2024-03-08 16:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 16:35 [Bug c++/103499] New: C++20 modules error: invalid use of non-static member function oleg at smolsky dot net
2022-09-02 20:28 ` [Bug c++/103499] " markmigm at gmail dot com
2022-09-03 20:43 ` markmigm at gmail dot com
2022-09-08  4:58 ` markmigm at gmail dot com
2023-06-02 19:27 ` pinskia at gcc dot gnu.org
2023-06-05  8:38 ` redi at gcc dot gnu.org
2023-06-05 13:44 ` markmigm at gmail dot com
2023-11-14 19:43 ` cvs-commit at gcc dot gnu.org
2024-02-10  4:32 ` nshead at gcc dot gnu.org
2024-03-08 16:03 ` 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).