[PATCH] D31778: [Modules] Implement ODR-like semantics for tag types in C/ObjC

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 18:11:18 PDT 2017


bruno added inline comments.


================
Comment at: include/clang/AST/ASTStructuralEquivalence.h:52
 
+  /// \brief Whether warn or error on tag type mismatches.
+  bool ErrorOnTagTypeMismatch;
----------------
aprantl wrote:
> No need to use \brief in new code any more. We are compiling with the Doxygen autobrief option.
Sure, updated D31777 to also remove the `\brief`s in the transition


================
Comment at: lib/Parse/ParseDecl.cpp:4316
+        !Actions.hasStructuralCompatLayout(TagDecl, CheckCompatTag.NewDef)) {
+      DS.SetTypeSpecError(); // Bail out...
+      return;
----------------
aprantl wrote:
> I think the LLVM coding style wants this to be 
> ```
> {
>     // Bail out.
>     DS.SetTypeSpecError();
>     return;
> }
> ```
> 
> or
> ```
> // Bail out.
> return DS.SetTypeSpecError();
> ```
OK


================
Comment at: lib/Sema/SemaDecl.cpp:13386
+              bool AllowODR = getLangOpts().CPlusPlus || getLangOpts().ObjC1 ||
+                              getLangOpts().C11;
               NamedDecl *Hidden = nullptr;
----------------
aprantl wrote:
> Does `ObjC2` imply `ObjC1`?
Yep!


https://reviews.llvm.org/D31778





More information about the cfe-commits mailing list