Repository navigation
Builtins (__add_lvalue_reference/__add_rvalue_reference/etc.) return incorrect types for CV/ref-qualified function types #15
Michael137
started this conversation in
Issue Triage - Compilation
Replies: 1 comment
|
The proposed patch looks good, programmatically. I'd add some comments. |
0 replies
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.
Issue Summary
Given following code:
The
static_asserts fail with stock EDG (checked 6.8 and 6.9) but pass with clang/gcc: https://godbolt.org/z/b44zKeosbFor reference: https://cplusplus.github.io/LWG/issue2101
patch.txt
Attached an LLM-generated patch and EDG config.
edg_config.txt
patch.txt
Reproducing Source Code
template<class, class>
constexpr bool is_same_v = false;
template
constexpr bool is_same_v<T, T> = true;
template struct add_lvalue_reference { using type = __add_lvalue_reference(T); };
template struct add_rvalue_reference { using type = __add_rvalue_reference(T); };
template struct add_pointer { using type = __add_pointer(T); };
template struct decay { using type = __decay(T); };
using WithCVQual = void() const;
using WithRefQual = void() const;
static_assert(is_same_v<WithCVQual, typename add_lvalue_reference::type>);
static_assert(is_same_v<WithCVQual, typename add_rvalue_reference::type>);
static_assert(is_same_v<WithCVQual, typename add_pointer::type>);
static_assert(is_same_v<WithCVQual, typename decay::type>);
static_assert(is_same_v<WithRefQual, typename add_lvalue_reference::type>);
static_assert(is_same_v<WithRefQual, typename add_rvalue_reference::type>);
static_assert(is_same_v<WithRefQual, typename add_pointer::type>);
static_assert(is_same_v<WithRefQual, typename decay::type>);
int main() {}
Command-line Options
edgcpfe --c++17
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
Compiles with GCC 15 and Clang 16
Reproducing (Standard) Configuration(s)
linux-clang-release, linux-gcc-release
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