================ @@ -1921,7 +1920,20 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD, bool IsKnownNewer) const { } bool NamedDecl::hasLinkage() const { - return getFormalLinkage() != NoLinkage; + switch (getFormalLinkage()) { + case Linkage::Invalid: + llvm_unreachable("Linkage hasn't been computed!"); + case Linkage::None: + return false; + case Linkage::Internal: + return true; + case Linkage::UniqueExternal: + case Linkage::VisibleNone: + llvm_unreachable("Non-formal linkage is not allowed here!"); ---------------- AaronBallman wrote:
Ah I see the logic now, this is actually an NFC change. I think it's fine to leave in as-is in this patch. https://github.com/llvm/llvm-project/pull/71049 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits