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
#506's resolution for #550 adds quite some complexity to Cppfront.
The same can be done here to resolve this #788.
The alternative is to just embrace #550 and #788 as limitations of Cppfront,
and require users to not name such variables like the function in a UFCS call.
I have potential solutions in mind for this one.
But they also bring complexity to the code of Cppfront.
Maybe trial constant evaluation can be leveraged for a seamless user experience.
An alternative would be to disable UFCS
when in a constant expression (so Cppfront has to know about those)
and f isn't part of the constant expression (determined by lexical name lookup).
Title: UFCS fails during constant evaluation only.
Description:
Given a parameter named after the function being called,
UFCS will fail during constant evaluation only
in the case UFCS would call a member function.
Minimal reproducer (https://cpp2.godbolt.org/z/jKWG4boaq, https://compiler-explorer.com/z/zeqW6MEPK):
Commands:
cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp
Expected result: A well-formed program that calls the member function.
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
The text was updated successfully, but these errors were encountered: