[PATCH] D70905: Actually delay processing DelayedDllExportClasses until the outermost class is finished (PR40006)

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 15:05:29 PST 2019


rnk added a comment.

It occurs to me that this will cause some strange ordering in some cases. Consider:

  namespace pr40006 {
  // Delay emitting the method also past the instantiation of Tmpl<Inner>, i.e.
  // until the top-level class Outer is completely finished.
  template<typename> struct Tmpl {};
  struct Outer {
      struct Inner {
          __declspec(dllexport) Inner() = default;
          unsigned int x = 0;
      };
      // not instantiated
  };
  
  struct Other {
      Tmpl<Outer::Inner> y;
  };
  // M32-DAG: define weak_odr dso_local dllexport x86_thiscallcc %"struct.InClassInits::pr40006::Outer::Inner"* @"??0Inner at Outer@pr40006 at InClassInits@@QAE at XZ"
  }

When we'd process `y` before, we would immediately emit delayed dllexported things. Now we will wait until Other is done parsing, which is fine, but not as eager as we could be. That's fine, but it's a slight behavior change.



================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:2232
+  if (ParsingClassDepth == 0)
+    ActOnFinishCXXNonNestedClass(Instantiation);
 
----------------
This function doesn't use its argument. Can you remove it so that is clear that we don't need to track this somewhere else?


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

https://reviews.llvm.org/D70905





More information about the cfe-commits mailing list