Title
Handling of deduction guides in global-module-fragment
Status
review
Section
10.4 [module.global.frag]
Submitter
Daniela Engert

Created on 2023-08-21.00:00:00 last changed 5 days ago

Messages

Date: 2023-09-16.07:00:56

Proposed resolution (approved by CWG 2023-08-25):

Add a new bullet after 10.4 [module.global.frag] bullet 3.5.7 as follows:

  • ...
  • there exists a declaration M that is not a namespace-definition for which M is decl-reachable from S and either
    • ...
    • one of M and D declares a template and the other declares a partial or explicit specialization or an implicit or explicit instantiation of that template, or
    • one of M and D declares a class template and the other declares a deduction guide for that template, or

Simplified resolution:

Add a new bullet after 10.4 [module.global.frag] bullet 3.5.7 as follows:

  • ...
  • there exists a declaration M that is not a namespace-definition for which M is decl-reachable from S and either
    • ...
    • one of M and D declares a template and the other declares a partial or explicit specialization or an implicit or explicit instantiation of that template, or
    • M declares a class template and D is a deduction guide for that template, or
Date: 2023-09-16.07:00:56

Consider:

  // header "S.h"

  template<class T>
  struct S {
    S(const T*);
  };
  template<class T>
  S(T*) -> S<T>

  // translation unit
  module;
  #include "S.h"

  export module M;
  export using ::S;

Obviously, the using-declaration referring to the class template S is exported by M, but what about the deduction guide of S?

History
Date User Action Args
2023-09-16 07:00:56adminsetstatus: tentatively ready -> review
2023-08-26 21:49:54adminsetstatus: open -> tentatively ready
2023-08-21 18:52:09adminsetmessages: + msg7398
2023-08-21 00:00:00admincreate