public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106826] New: [modules] Variable template of type trait via importable header gives wrong result
@ 2022-09-04 17:57 johelegp at gmail dot com
  2022-09-05 18:59 ` [Bug c++/106826] [13 Regression] " johelegp at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: johelegp at gmail dot com @ 2022-09-04 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106826
           Summary: [modules] Variable template of type trait via
                    importable header gives wrong result
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/Yjrcv6sG1.

```sh
CXX=/home/johel/root/gcc/bin/g++
echo "./my.std.headers.hpp my.std.headers.gcm
my.std my.std.gcm
my.module my.module.gcm" > mm.txt
echo "#include <type_traits>" > my.std.headers.hpp
echo "export module my.std;
export import \"my.std.headers.hpp\";" > my.std.cpp
echo "export module my.module;
import my.std;
static_assert(std::is_lvalue_reference_v<int&>);
export int _;" > my.module.cpp
$CXX -std=c++23 -fmodules-ts -fmodule-mapper=mm.txt -x c++-header -c
my.std.headers.hpp
$CXX -std=c++23 -fmodules-ts -fmodule-mapper=mm.txt -c my.std.cpp
$CXX -std=c++23 -fmodules-ts -fmodule-mapper=mm.txt -c my.module.cpp
```

Output:
```
my.module.cpp:3:20: error: static assertion failed
    3 | static_assert(std::is_lvalue_reference_v<int&>);
      |               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
my.module.cpp:1:8: warning: not writing module ‘my.module’ due to errors
    1 | export module my.module;
      |        ^~~~~~
```

GCC12 passes the assertion.

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

end of thread, other threads:[~2022-09-25 17:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-04 17:57 [Bug c++/106826] New: [modules] Variable template of type trait via importable header gives wrong result johelegp at gmail dot com
2022-09-05 18:59 ` [Bug c++/106826] [13 Regression] " johelegp at gmail dot com
2022-09-21 12:29 ` ppalka at gcc dot gnu.org
2022-09-22  5:04 ` johelegp at gmail dot com
2022-09-22 12:47 ` cvs-commit at gcc dot gnu.org
2022-09-22 12:56 ` ppalka at gcc dot gnu.org
2022-09-22 12:57 ` ppalka at gcc dot gnu.org
2022-09-22 14:08 ` johelegp at gmail dot com
2022-09-25 17:14 ` johelegp at gmail dot com

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