You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect constraint check for call to module-imported function template with deduced return type #453
When a call to an uninstantiated function template with deduced return type appears in a requires-expression, and the function template is imported from a (MSVC-generated) IFC file, EDG evaluates the constraint to false, even though a direct call to the function template works fine.
Like #230, this bug affects the uses of IntelliSense with import std; because MSVC STL's std::ranges::begin has an operator() with a deduced return type, and std::ranges::range calls std::ranges::begin in its requires-expression.
Reproducing Source Code
mod1.ixx (compiled with MSVC's cl.exe /c /std:c++20 mod1.ixx):
example.cxx (compiled with \CXX\edgcpp-compiler\build\msvc-release\bin\cpfe.exe --ms_c++20 --modules example.cxx):
import mod1;
template<classT>
concept range = requires(T& t) {
fn(t);
};
static_assert(range<int(&)[1]>); // static assertion failed, should be OKintmain() {}
Command-line Options
cpfe.exe --ms_c++20 --modules example.cxx
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
The IFC file is generated by MSVC Compiler Version 19.52.36815 for x64 (PREVIEW). The file example.cxx compiles fine with cl.exe /std:c++20 example.cxx and fails to compile with cl.exe /BE /std:c++20 example.cxx.
This is the generated IFC file (zipped): mod1.ifc.zip
Reproducing (Standard) Configuration(s)
windows-msvc-release
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
I have checked open issues and existing discussions before filing this report.
The reproducing source code that I have provided does not depend on headers that I have not included with my submission.
I have reduced the reproducing source code to the best of my ability.
I have selected at least one standard configuration or uploaded a non-standard configuration dump.
I understand code shared via this form is NOT confidential.
I have permission to share the reproducing source code and grant permission for the project to use the source code (or derivatives of the source code) to create tests.
I agree that any tests created using the reproducing source code (or deriatives of it) will be licensed under project license unless I included a LICENSE.txt file in my .zip or .tar.gz upload. If I included a LICENSE.txt file, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.
Activity
Fix SFINAE for function template with deduced return type and pending…