transparent context.
(The same crash would happen if a class template with a friend was
declared in an 'export' block, but there are more issues with that
case.)
// Look only into the namespace where the friend would be declared to
// find a previous declaration. This is the innermost enclosing namespace,
// as described in ActOnFriendFunctionDecl.
- SemaRef.LookupQualifiedName(Previous, DC);
+ SemaRef.LookupQualifiedName(Previous, DC->getRedeclContext());
// In C++, the previous declaration we find might be a tag type
// (class or enum). In this case, the new declaration will hide the
(void)(v1 <=> v2); // expected-error {{three-way comparison between vectors is not supported}}
}
}
+
+namespace PR44992 {
+ extern "C++" struct s {
+ friend auto operator<=>(s const &, s const &) = default;
+ };
+}