[Bug c++/106826] [13 Regression] [modules] Variable template of type trait via importable header gives wrong result
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 21 12:29:02 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106826
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
CC| |ppalka at gcc dot gnu.org
Ever confirmed|0 |1
Target Milestone|--- |13.0
Last reconfirmed| |2022-09-21
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Confirmed, likely started with r13-2351-g33005a4be49466 though it's ultimately
a latent modules bug. Reduced testcase:
$ cat 106826_a.C
export module pr106826;
template<class T> constexpr bool is_lvalue_reference_v = false;
template<class T> constexpr bool is_lvalue_reference_v<T&> = true;
$ cat 106826_b.C
module pr106826;
static_assert(is_lvalue_reference_v<int&>);
$ g++ -fmodules-ts 106826_a.C
$ g++ -fmodules-ts 106826_b.C
106826_b.C:2:15: error: static assertion failed
It looks variable template partial specializations get lost during streaming.
More information about the Gcc-bugs
mailing list