-
Notifications
You must be signed in to change notification settings - Fork 260
[BUG] [Clang] UFCS on identifier also declared at type scope fails #555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
Something isn't working
Comments
May be related to llvm/llvm-project#58872. |
You don't actually need to involve other types (https://cpp2.godbolt.org/z/qo6PErbYq, https://compiler-explorer.com/z/EeMsaj1ca):
//=== Cpp2 type declarations ====================================================
#include "cpp2util.h"
class t;
//=== Cpp2 type definitions and function declarations ===========================
class t {
public: auto f() const -> void;
public: static auto g(auto const& x) -> void;
};
auto main() -> int;
//=== Cpp2 function definitions =================================================
auto t::f() const -> void{}
auto t::g(auto const& x) -> void { CPP2_UFCS_0(f, x); }
auto main() -> int{}
|
this
member function
Hitting this with Apple Clang 14.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Title: [Clang] UFCS on shared identifier between types in non-
this
member function.Description:
The type of
this
and the unrelated type sharef
.In a non-
this
member function,UFCS on
f
with the unrelated type breaks Clang.GCC and MSVC work, so it may be a Clang bug: https://compiler-explorer.com/z/vEEovohd3.
Minimal reproducer (https://cpp2.godbolt.org/z/qWjx6Pav7):
Commands:
cppfront main.cpp2 clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -I . main.cpp
Expected result: A working program.
Actual result and error:
Cpp2 lowered to Cpp1:
The text was updated successfully, but these errors were encountered: