Skip to content

Commit 2992560

Browse files
committed
Restore UFCS test, but current MSVC ICEs
1 parent b4762a8 commit 2992560

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

regression-tests/mixed-bugfix-for-ufcs-non-local.cpp2

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ d: _ == t<o.f()>(); // Fails on Clang 12 (lambda in unevaluated context).
3838

3939
u: @struct type = {
4040
b: bool == o.f();
41-
c: bool == :(forward x: decltype(f(o))) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
41+
c: bool == :(forward x: decltype(o.f())) = x;(true); // Fails on Clang 12 (lambda in unevaluated context).
4242
g: (s, sz) pre(s.sz() != 0) = { }
4343
}
4444

regression-tests/test-results/clang-12-c++20/mixed-bugfix-for-ufcs-non-local.cpp.output

+26-1
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,29 @@ mixed-bugfix-for-ufcs-non-local.cpp2:27:29: error: a lambda expression cannot ap
106106
../../../include/cpp2util.h:2099:66: note: expanded from macro 'CPP2_UFCS_'
107107
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
108108
^
109-
12 errors generated.
109+
mixed-bugfix-for-ufcs-non-local.cpp2:42:77: error: no matching function for call to object of type 'ns::u::(lambda at mixed-bugfix-for-ufcs-non-local.cpp2:42:77)'
110+
requires (std::is_convertible_v<CPP2_TYPEOF(x), std::add_const_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>&>) { return CPP2_FORWARD(x); }(true) };
111+
^~~~~~~~~~~~~~~~~~~~~
112+
../../../include/cpp2util.h:2137:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
113+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
114+
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115+
../../../include/cpp2util.h:2099:66: note: expanded from macro 'CPP2_UFCS_'
116+
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
117+
^
118+
mixed-bugfix-for-ufcs-non-local.cpp2:42:77: note: candidate template ignored: couldn't infer template argument 'Obj'
119+
../../../include/cpp2util.h:2137:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
120+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
121+
^
122+
../../../include/cpp2util.h:2099:66: note: expanded from macro 'CPP2_UFCS_'
123+
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
124+
^
125+
mixed-bugfix-for-ufcs-non-local.cpp2:42:77: error: lambda expression in an unevaluated operand
126+
requires (std::is_convertible_v<CPP2_TYPEOF(x), std::add_const_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>&>) { return CPP2_FORWARD(x); }(true) };
127+
^
128+
../../../include/cpp2util.h:2137:59: note: expanded from macro 'CPP2_UFCS_NONLOCAL'
129+
#define CPP2_UFCS_NONLOCAL(...) CPP2_UFCS_(,CPP2_UFCS_IDENTITY,CPP2_UFCS_IDENTITY,(),,__VA_ARGS__)
130+
^
131+
../../../include/cpp2util.h:2099:66: note: expanded from macro 'CPP2_UFCS_'
132+
#define CPP2_UFCS_(LAMBDADEFCAPT,SFINAE,MVFWD,QUALID,TEMPKW,...) \
133+
^
134+
14 errors generated.

regression-tests/test-results/mixed-bugfix-for-ufcs-non-local.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ auto g() -> void{
9797
inline CPP2_CONSTEXPR bool u::b{ CPP2_UFCS_NONLOCAL(f)(o) };
9898
inline CPP2_CONSTEXPR bool u::c{ [](auto&& x) -> decltype(auto)// Fails on Clang 12 (lambda in unevaluated context).
9999
#line 42 "mixed-bugfix-for-ufcs-non-local.cpp2"
100-
requires (std::is_convertible_v<CPP2_TYPEOF(x), std::add_const_t<decltype(f(o))>&>) { return CPP2_FORWARD(x); }(true) };
100+
requires (std::is_convertible_v<CPP2_TYPEOF(x), std::add_const_t<decltype(CPP2_UFCS_NONLOCAL(f)(o))>&>) { return CPP2_FORWARD(x); }(true) };
101101
#line 42 "mixed-bugfix-for-ufcs-non-local.cpp2"
102102
auto u::g(auto const& s, auto const& sz) -> void{
103103
if (cpp2::cpp2_default.is_active() && !(CPP2_UFCS(sz)(s) != 0) ) { cpp2::cpp2_default.report_violation(""); }}
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
mixed-bugfix-for-ufcs-non-local.cpp
2+
mixed-bugfix-for-ufcs-non-local.cpp2(42): fatal error C1001: Internal compiler error.
3+
(compiler file 'msc1.cpp', line 1593)
4+
To work around this problem, try simplifying or changing the program near the locations listed above.
5+
If possible please provide a repro here: https://developercommunity.visualstudio.com
6+
Please choose the Technical Support command on the Visual C++
7+
Help menu, or open the Technical Support help file for more information
8+
INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\cl.exe'
9+
Please choose the Technical Support command on the Visual C++
10+
Help menu, or open the Technical Support help file for more information

0 commit comments

Comments
 (0)