mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
Fix GH57943: Friend constraint checker didn't handle null decls.
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.
This commit is contained in:
parent
ddfa0f62d8
commit
0d18815baf
@ -1716,6 +1716,8 @@ public:
|
||||
}
|
||||
|
||||
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
|
||||
|
7
clang/test/SemaTemplate/gh57943.cpp
Normal file
7
clang/test/SemaTemplate/gh57943.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
// 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);
|
||||
};
|
Loading…
Reference in New Issue
Block a user