vsapsai added inline comments.

================
Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:818
+    // performance.
+    RecordDecl *Canon = static_cast<RecordDecl *>(RD->getCanonicalDecl());
+    if (RD == Canon || Canon->getODRHash() == RD->getODRHash())
----------------
During investigation of a different issue noticed there is no error for the 
following test case

```lang=c++
#if defined(FIRST)
typedef struct FW FW;
struct FW {
  int x;
};
#elif defined(SECOND)
struct FW {
  float a;
};
#else
struct FW fw;
#endif
```

And that is because `Canon` is a forward declaration from the typedef and we 
don't compare non-definition with definition.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71734

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D71734: [Modules]... Volodymyr Sapsai via Phabricator via cfe-commits

Reply via email to