public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Modules and using declaration: bug or feature?
@ 2023-05-08  5:18 Wilhelm Meier
  0 siblings, 0 replies; only message in thread
From: Wilhelm Meier @ 2023-05-08  5:18 UTC (permalink / raw)
  To: gcc-help

Hi all,

I have the following file:

m.h:
---
using test_t = unsigned char;
---

m1.cc
---
module;

#include "m.h"

export module m1;

export namespace M1 {
    using ::test_t;
}
---

and m2.cc:
---
module;

export module m2;

export import m1;

export namespace M1 {
    using x = test_t;
}
---

Compile the module interface unit m1.cc succeeds:

LANG=C g++ -c -std=c++23 -DNDEBUG -Os -fconcepts -fmodules-ts 
-fmodule-only -xc++ m1.cc

But compiling m2.cc fails:

LANG=C g++ -c -std=c++23 -DNDEBUG -Os -fconcepts -fmodules-ts 
-fmodule-only -xc++ m2.cc

m2.cc:8:19: error: 'test_t' does not name a type
8 |         using x = test_t;
|                   ^~~~~~
m2.cc:3:8: warning: not writing module 'm2' due to errors
3 | export module m2;
|        ^~~~~~

Is this a bug or a feature?

--
  Wilhelm

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-08  5:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08  5:18 Modules and using declaration: bug or feature? Wilhelm Meier

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).