[all-commits] [llvm/llvm-project] 40ad66: [dllexport] odr-use constexpr default args for con...

Hans via All-commits all-commits at lists.llvm.org
Mon Apr 11 07:25:07 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40ad6670138ab8130a426432b0e94544b5e03642
      https://github.com/llvm/llvm-project/commit/40ad6670138ab8130a426432b0e94544b5e03642
  Author: Hans Wennborg <hans at chromium.org>
  Date:   2022-04-11 (Mon, 11 Apr 2022)

  Changed paths:
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/CodeGenCXX/dllexport-ctor-closure.cpp

  Log Message:
  -----------
  [dllexport] odr-use constexpr default args for constructor closures

InstantiateDefaultCtorDefaultArgs() is supposed to mark default
constructor args as odr-used, since those args will be used when
emitting the constructor closure.

However, constexpr vars were not getting odr-used since
DoMarkVarDeclReferenced() defers them in MaybeODRUseExprs, and the code
was calling CleanupVarDeclMarking() which discarded those uses instead
of processing them.

(This came up in Chromium, crbug.com/1312086)

Differential revision: https://reviews.llvm.org/D123405




More information about the All-commits mailing list