During explicit instantiation of dllexport class templates, we would end up trying to emit constexpr methods (at least) twice:
- MarkFunctionReferenced would cause it to be emitted, and
- InstantiateClassMembers would then emit it again
(3. if we had gotten this far, we'd then call HandleTopLevelDecl on it, which would be the third emission attempt)
This sounds like "determine whether either (a) the definition must be emitted or (b) the definition can be emitted lazily" whereas I think you mean "determine whether the definition must be emitted; if this returns \c false, the definition can be emitted lazily if it's used".