[Bug c++/113405] Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module

2024-01-27 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113405

Nathaniel Shead  changed:

   What|Removed |Added

   Target Milestone|--- |14.0
   Assignee|unassigned at gcc dot gnu.org  |nshead at gcc dot 
gnu.org
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Nathaniel Shead  ---
Fixed for GCC 14.

[Bug c++/113405] Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module

2024-01-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113405

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Nathaniel Shead :

https://gcc.gnu.org/g:6ff54cc0be8dfa9d9bd5922ec65e86c9eb644711

commit r14-8408-g6ff54cc0be8dfa9d9bd5922ec65e86c9eb644711
Author: Nathaniel Shead 
Date:   Fri Jan 19 22:24:18 2024 +1100

c++: Handle partial specialisations in GMF [PR113405]

Currently, when exporting names from the GMF, or within header modules,
for a set of constrained partial specialisations we only emit the first
one. This is because the 'type_specialization' list only includes a
single specialization per template+argument list; constraints are not
considered here.

The existing code uses a separate 'partial_specializations' list to
track this instead, but currently it's only used for declarations in the
module purview. This patch makes use of this list for all declarations.

PR c++/113405

gcc/cp/ChangeLog:

* module.cc (set_defining_module): Track partial specialisations
for all declarations.

gcc/testsuite/ChangeLog:

* g++.dg/modules/concept-9.h: New test.
* g++.dg/modules/concept-9_a.C: New test.
* g++.dg/modules/concept-9_b.C: New test.
* g++.dg/modules/concept-10_a.H: New test.
* g++.dg/modules/concept-10_b.C: New test.

Signed-off-by: Nathaniel Shead 

[Bug c++/113405] Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module

2024-01-18 Thread nathanieloshead at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113405

Nathaniel Shead  changed:

   What|Removed |Added

 CC||nathanieloshead at gmail dot 
com

--- Comment #4 from Nathaniel Shead  ---
The issue seems to be that 'depset::hash::add_specializations' only adds the
first of a set of constrained specialisations that use the same arguments. This
comes down to the fact that the 'type_specializations' hashset is only hashed
on the base template and the provided arguments: differently constrained
specialisations just aren't added.

Other parts of the dependency walker seem to handle this OK, by walking the
DECL_TEMPLATE_SPECIALIZATIONS list, but not the base 'specialization_add'
function.

I'm not entirely sure yet what the best way to approach solving this is.

[Bug c++/113405] Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module

2024-01-15 Thread eddiejnolan at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113405

--- Comment #3 from Eddie Nolan  ---
Fixed (first two commands were superfluous):

echo "module1 module1.gcm" >> ./module1.cpp.o.modmap
echo "module2 module2.gcm" >> ./module2.cpp.o.modmap
echo "module1 module1.gcm" >> ./module2.cpp.o.modmap
g++ -I./include -g -std=c++20 -MD -MT ./module1.cpp.o -MF ./module1.cpp.o.d \
-fmodules-ts -fmodule-mapper=./module1.cpp.o.modmap -MD \
-fdeps-format=p1689r5 -x c++ -o ./module1.cpp.o -c ./module1.cpp
g++ -g -std=c++20 -MD -MT ./module2.cpp.o -MF ./module2.cpp.o.d \
-fmodules-ts -fmodule-mapper=./module2.cpp.o.modmap -MD \
-fdeps-format=p1689r5 -x c++ -o ./module2.cpp.o -c ./module2.cpp

[Bug c++/113405] Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module

2024-01-15 Thread eddiejnolan at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113405

--- Comment #2 from Eddie Nolan  ---
This series of commands reproduces the issue and does not use CMake:

g++ -g -std=c++20 -E -x c++ ./module2.cpp \
-MT ./module2.cpp.o.ddi -MD -MF ./module2.cpp.o.ddi.d \
-fmodules-ts -fdeps-file=./module2.cpp.o.ddi -fdeps-target=./module2.cpp.o
\
-fdeps-format=p1689r5 -o ./module2.cpp.o.ddi.i
g++ -I./include -g -std=c++20 -E -x c++ ./module1.cpp \
-MT ./module1.cpp.o.ddi -MD -MF ./module1.cpp.o.ddi.d \
-fmodules-ts -fdeps-file=./module1.cpp.o.ddi -fdeps-target=./module1.cpp.o
\
-fdeps-format=p1689r5 -o ./module1.cpp.o.ddi.i
echo "module1 module1.gcm" >> ./module1.cpp.o.modmap
echo "module2 module2.gcm" >> ./module2.cpp.o.modmap
echo "module1 module1.gcm" >> ./module2.cpp.o.modmap
g++ -I./include -g -std=c++20 -MD -MT ./module1.cpp.o -MF ./module1.cpp.o.d \
-fmodules-ts -fmodule-mapper=./module1.cpp.o.modmap -MD \
-fdeps-format=p1689r5 -x c++ -o ./module1.cpp.o -c ./module1.cpp
g++ -g -std=c++20 -MD -MT ./module2.cpp.o -MF ./module2.cpp.o.d \
-fmodules-ts -fmodule-mapper=./module2.cpp.o.modmap -MD \
-fdeps-format=p1689r5 -x c++ -o ./module2.cpp.o -c ./module2.cpp

[Bug c++/113405] Can't access member type alias of concept-constrained class template specialization in global module fragment via alias template in different module

2024-01-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113405

Andrew Pinski  changed:

   What|Removed |Added

 Blocks||103524

--- Comment #1 from Andrew Pinski  ---
It would be useful if you don't use cmake here since it is so simple to figure
out the full command line for building here.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue