[PATCH] D121177: [modules] Merge equivalent extensions and diagnose ivar redeclarations for extensions loaded from different modules.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 21:34:38 PDT 2022


vsapsai added inline comments.


================
Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:1261-1263
+      Reader.Diag(IVD->getLocation(), diag::err_duplicate_ivar_declaration)
+          << II;
+      Reader.Diag(PrevIvar->getLocation(), diag::note_previous_definition);
----------------
We emit diagnostic for
```lang=objective-c
@implementation TestClass {
@public
  struct { int z; } implementationIvar;
}
@end
```

from merge-anon-record-definition-in-objc.m because we handle only `ObjCCategoryDecl` and not `ObjCImplementationDecl`. It is very uncommon to put implementation in a header file but I still need to check we don't emit duplicate ivar metadata in this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121177/new/

https://reviews.llvm.org/D121177



More information about the cfe-commits mailing list