[all-commits] [llvm/llvm-project] 2d75b2: [MS] Fix constexpr data member pointer conversions

Reid Kleckner via All-commits all-commits at lists.llvm.org
Wed Oct 30 11:33:30 PDT 2019


  Branch: refs/heads/release/9.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d75b245668a49815935687b9a70beddbc68f66c
      https://github.com/llvm/llvm-project/commit/2d75b245668a49815935687b9a70beddbc68f66c
  Author: Reid Kleckner <rnk at google.com>
  Date:   2019-10-30 (Wed, 30 Oct 2019)

  Changed paths:
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    M clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp

  Log Message:
  -----------
  [MS] Fix constexpr data member pointer conversions

Constexpr data member conversions work by starting with the class that
originally introduced the field, and converting from there to the type
that the user desires. Before this change, Clang was using the
inheritance model from the final destination class type instead of the
model from the class that originally introduced the field. To fix this,
find the relevant FieldDecl and take its parent class instead of using
the member pointer type the user provided.

Indirect field decls require some special handling to find the parent
class.

Fixes PR43803

(cherry picked from commit 07ee46d613d7c1862878d7c7d1208a7b3e37459d)




More information about the All-commits mailing list