Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/exprutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ exprutil.c -- Expression scanning utility routines.
#include "lower_il.h"
#endif /* DO_IL_LOWERING */
#include "statements.h"
#include "modules.h"
#if USE_X86_FUNCTION_MULTIVERSIONING
#include "sys_predef.h"
#endif /* USE_X86_FUNCTION_MULTIVERSIONING */
Expand Down Expand Up @@ -18149,11 +18150,12 @@ reference entry, or is NULL if none is needed.
if (tip != NULL) {
a_symbol_ptr tsym;
tsym = prototype_template_if_template_symbol(tip->template_sym);
if (tsym->defined) {
if (tsym->defined ||
has_pending_template_definition_from_module(
routine->assoc_template)) {
could_be_instantiated = TRUE;
} /* if */
} else if (routine_sym->variant.routine.ptr
->friend_defined_in_instantiation) {
} else if (routine->friend_defined_in_instantiation) {
could_be_instantiated = TRUE;
} /* if */
if (!could_be_instantiated) {
Expand Down
7 changes: 7 additions & 0 deletions src/pending_changes/gh-453.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[GH #453]
SFINAE for function template with pending definition and deduced return type

With modules, it is possible that a function template definition exists in a
module but the definition is not yet loaded. Previously, substitution failed
if such a function template is called in a SFINAE context and the function
template has a deduced return type. This is now fixed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export module A;

export template<class T>
auto fn(T&)
{
return 42;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//type:fp
//options_all:--ms_c++20 -tused --modules --microsoft_version 1952 --ms_mod_file_map A.ifc --target win64

import A;

template<class T>
concept C = requires(T& t) {
::fn(t);
};

static_assert(C<int>);

int main() {}
Loading