[PATCH] D95408: [Sema][C] members of anonymous struct inherit QualType

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 25 16:23:50 PST 2021


nickdesaulniers added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:5179
   if (RecordDecl *OwningClass = dyn_cast<RecordDecl>(Owner)) {
-    Anon = FieldDecl::Create(
-        Context, OwningClass, DS.getBeginLoc(), Record->getLocation(),
-        /*IdentifierInfo=*/nullptr, Context.getTypeDeclType(Record), TInfo,
-        /*BitWidth=*/nullptr, /*Mutable=*/false,
-        /*InitStyle=*/ICIS_NoInit);
+    QualType QT = Context.getTypeDeclType(Record);
+    if (!getLangOpts().CPlusPlus) {
----------------
Maybe there's a way to have `Context.getTypeDeclType` return the qualified type here? (I couldn't find a way, but only looked today).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95408



More information about the cfe-commits mailing list