Repository navigation
A type-transforming builtin in a friend template's requires-clause is lost when the enclosing class template is instantiated #535
jonatanlinden
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
A friend function template defined in a class template, whose requires-clause applies a type-transforming builtin such as
__remove_cvref(T)to the friend's own template parameter, never sees the builtin applied. When the function is called with an lvalue,Tis deduced as a reference type, the constraint is evaluated with the reference still on,__is_base_ofis false, and no candidate matches. The code is rejected with "error: no operator "!" matches these operands".With an rvalue operand the code is accepted.
Reproducing Source Code
Command-line Options
cpfe --c++20 --no_code_gen repro.cpp
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
Also doesn't compile with:
clang and GCC both accept the code. https://godbolt.org/z/EcE5fG6ET
The pattern comes from libc++'s
__range_adaptor_closure, soarr | std::views::reversefails to compile with EDG.The full diagnostic produced is:
Reproducing (Standard) Configuration(s)
linux-gcc-debug
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions