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
auto y = [](auto &v) -> void { v.n = 0; };// cxx11-error {{'auto' not allowed in lambda parameter}} cxx11-note {{candidate function not viable}} cxx11-note {{conversion candidate}}
friendautoT::operator()(int) const;// cxx11-error {{'auto' return without trailing return type; deduced return types are a C++14 extension}}
627
+
friendautoT::operator()(int) const;
630
628
friend T::operatorExpectedTypeT() const;
631
629
632
630
template<typename T>
633
-
friendvoidU::operator()(T&) const;// cxx11-error {{friend declaration of 'operator()' does not match any declaration}}
631
+
friendvoidU::operator()(T&) const;
634
632
// FIXME: This should not match, as above.
635
633
template<typename T>
636
-
friend U::operator ExpectedTypeU<T>() const;// cxx11-error {{friend declaration of 'operator void (*)(type-parameter-0-0 &)' does not match any declaration}}
634
+
friend U::operator ExpectedTypeU<T>() const;
637
635
#endif
638
636
639
637
private:
640
638
int n;
641
639
};
642
640
643
-
// Should be OK in C++14 and later: lambda's call operator is a friend.
644
-
voiduse(X &x) { y(x); }// cxx11-error {{no matching function for call to object}}
641
+
// Should be OK: lambda's call operator is a friend.
642
+
voiduse(X &x) { y(x); }
645
643
646
644
// This used to crash in return type deduction for the conversion opreator.
647
645
structA { int n; voidf() { +[](decltype(n)) {}; } };
0 commit comments