[PATCH] D130327: [ODRHash] Detect duplicate `ObjCProtocolDecl` ODR mismatches during parsing.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 19:57:21 PDT 2022


vsapsai created this revision.
Herald added a subscriber: ributzka.
Herald added a project: All.
vsapsai requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When during parsing we encountered a duplicate `ObjCProtocolDecl`, we
were always emitting an error. With this change we accept

- when a previous `ObjCProtocolDecl` is in a hidden [sub]module;
- parsed `ObjCProtocolDecl` is the same as the previous one.

And in case of mismatches we provide more detailed error messages.

rdar://93069080


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130327

Files:
  clang/include/clang/AST/DeclObjC.h
  clang/include/clang/AST/ODRDiagsEmitter.h
  clang/include/clang/Basic/DiagnosticASTKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/DeclObjC.cpp
  clang/lib/AST/ODRDiagsEmitter.cpp
  clang/lib/Parse/ParseObjc.cpp
  clang/lib/Sema/SemaDeclObjC.cpp
  clang/test/Modules/compare-objc-protocol.m
  clang/test/Modules/hidden-duplicates.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130327.446697.patch
Type: text/x-patch
Size: 30539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220722/904629f3/attachment-0001.bin>


More information about the cfe-commits mailing list