[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 04:06:04 PST 2024


================
@@ -5914,8 +5914,10 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
     //
     // ... for instance.
     if (IsQualifiedFunction &&
-        !(Kind == Member && !D.isExplicitObjectMemberFunction() &&
-          D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_static) &&
+        (Kind != Member || D.isExplicitObjectMemberFunction() ||
+         D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static ||
+         (D.getContext() == clang::DeclaratorContext::Member &&
----------------
cor3ntin wrote:

I think this is worth a comment

https://github.com/llvm/llvm-project/pull/80327


More information about the cfe-commits mailing list