public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109679] New: export using for functions does not work as specified
@ 2023-04-29  8:37 nico at josuttis dot de
  2023-04-29 21:38 ` [Bug c++/109679] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: nico at josuttis dot de @ 2023-04-29  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109679
           Summary: export using for functions does not work as specified
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nico at josuttis dot de
  Target Milestone: ---

Consider the following simple module export scenario to wrap a header file in a
module:

//***** foo.hpp:

#ifndef FOO_HPP
#define FOO_HPP

inline int foo()
{
  return 42;
}

#endif // FOO_HPP


//***** foomod.cppm:

module;

#include "foo.hpp"

export module FooMod;

export using ::foo;


//***** testfoo.cpp:

import FooMod;

int main()
{
  return foo();
}


According to the example 2 in "6.6 Program and linkage [basic.link]" and
example 2 in "10.2 Export declaration [module.interface]" this should work
(function f() in both examples).

This is an important feature because it alows programmers to softly migrate
header files to modules.

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

end of thread, other threads:[~2024-01-27 10:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29  8:37 [Bug c++/109679] New: export using for functions does not work as specified nico at josuttis dot de
2023-04-29 21:38 ` [Bug c++/109679] " pinskia at gcc dot gnu.org
2023-05-02 14:33 ` redi at gcc dot gnu.org
2023-12-25 13:12 ` admin at hexadigm dot com
2024-01-07 10:52 ` cvs-commit at gcc dot gnu.org
2024-01-27 10:21 ` nshead at gcc dot gnu.org
2024-01-27 10:28 ` nshead 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).