================
@@ -343,7 +343,11 @@ namespace {
         }
       }
 
-      llvm_unreachable("no Attr* for AttributedType*");
+      // The AttributedType can be inherited from another declarator, for
+      // example when __typeof__ reuses a type built for a different
+      // declaration, in which case there is no entry for it in this
+      // TypeProcessingState. Return null in that case.
+      return nullptr;
----------------
ahatanak wrote:

To clarify: I read your second paragraph as suggesting we register an `Attr *` 
before `fillAttributedTypeLoc()` is called, so that lookup never comes up 
empty. But the question then becomes which `Attr *` to register. 
`__typeof__(s->f1)` doesn't create any new `Attr *` of its own, so the only one 
available is the one on `NullabilityAtomicTypeofS::f1`, which has the problem I 
described above.

https://github.com/llvm/llvm-project/pull/220139
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to