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}}
628
630
friend T::operatorExpectedTypeT() const;
629
631
630
632
template<typename T>
631
-
friendvoidU::operator()(T&) const;
633
+
friendvoidU::operator()(T&) const;// cxx11-error {{friend declaration of 'operator()' does not match any declaration}}
632
634
// FIXME: This should not match, as above.
633
635
template<typename T>
634
-
friend U::operator ExpectedTypeU<T>() const;
636
+
friend U::operator ExpectedTypeU<T>() const;// cxx11-error {{friend declaration of 'operator void (*)(type-parameter-0-0 &)' does not match any declaration}}
635
637
#endif
636
638
637
639
private:
638
640
int n;
639
641
};
640
642
641
-
// Should be OK: lambda's call operator is a friend.
642
-
voiduse(X &x) { y(x); }
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}}
643
645
644
646
// This used to crash in return type deduction for the conversion opreator.
645
647
structA { int n; voidf() { +[](decltype(n)) {}; } };
@@ -733,6 +735,8 @@ void GH67492() {
733
735
auto lambda = (test, []() noexcept(true) {});
734
736
}
735
737
738
+
// FIXME: This currently causes clang to crash in C++11 mode.
739
+
#if __cplusplus >= 201402L
736
740
namespaceGH83267 {
737
741
auto l = [](auto a) { return1; };
738
742
using type = decltype(l);
@@ -747,3 +751,4 @@ using t = decltype(ll);
747
751
template autot::operator()<int>(int a) const; // expected-note {{in instantiation}}
0 commit comments