Apparently TransformDecl in TreeTransform can be called with a nullptr
for a Decl, so my casts were illegal. The fix here is to add an early
exit to my TransformDecl.
}
Decl *TransformDecl(SourceLocation Loc, Decl *D) {
+ if (!D)
+ return D;
// FIXME : This is possibly an incomplete list, but it is unclear what other
// Decl kinds could be used to refer to the template parameters. This is a
// best guess so far based on examples currently available, but the
--- /dev/null
+// RUN: %clang_cc1 -std=c++20 -verify %s
+// expected-no-diagnostics
+struct s {
+ template<typename T>
+ requires requires(T x) { x.g(); }
+ friend void f(T);
+};