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

Gregory Dushkin <yagreg7 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yagreg7 at gmail dot com

--- Comment #1 from Gregory Dushkin <yagreg7 at gmail dot com> ---
The issue is still present in GCC 13.2.1 and appears to only affect the actual
variables but not references to them.
E.g. the code:
```
// test.cc
export module test;
export constexpr int a = 42;
// main.cc
import test;
int main() { return a; }
```
would give:
```
$ g++ test.cc -std=c++20 -fmodules-ts -c
$ g++ main.cc -std=c++20 -fmodules-ts -c
main.cc: In function ‘int main()’:
main.cc:4:12: error: ‘a’ was not declared in this scope
    4 |     return a;
      |
```

but

```
// test.cc
export module test;
export constexpr int a_ = 42;
export constexpr const int& a = a_;
// main.cc
import test;
int main() { return a; }
```
compiles successfully using the same commands.

Reply via email to