This is an archive of the discontinued LLVM Phabricator instance.

[clang][MSVC] Fix missing MSInheritanceAttr in template specialization.
ClosedPublic

Authored by zequanwu on Jan 13 2021, 7:15 PM.

Diff Detail

Event Timeline

zequanwu requested review of this revision.Jan 13 2021, 7:15 PM
zequanwu created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2021, 7:15 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
zequanwu added inline comments.Jan 13 2021, 7:18 PM
clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
151–159

I tried to put the following CHECK for this, it never works no matter where I put namespace pr48687 nor changing CHECK to CHECK-DAG works.
// CHECK: @"?address@?$A@M@pr48687@@2QQ12@MQ12@" = weak_odr dso_local constant i32 0, comdat, align 1

So, as long as it does not crash/error, it might be fine.

zequanwu updated this revision to Diff 316694.Jan 14 2021, 9:56 AM

Update test case.

zequanwu added inline comments.Jan 14 2021, 9:57 AM
clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
151–159

NVM, the align should be 4.

rnk added a comment.Jan 14 2021, 9:59 AM

Thanks, this seems like the right spot.

clang/lib/Sema/SemaTemplate.cpp
9767

Let's remove this condition. There will only ever be inheritance attributes when the MS ABI is in use. I think fewer conditions is usually better.

clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
151–159

I see you sorted this out, thanks. I was going to suggest moving it earlier. Clang produces globals in a bit of an odd order.

zequanwu updated this revision to Diff 316695.Jan 14 2021, 10:04 AM
zequanwu marked an inline comment as done.

Address comment.

rnk accepted this revision.Jan 14 2021, 10:04 AM

lgtm

This revision is now accepted and ready to land.Jan 14 2021, 10:04 AM
This revision was landed with ongoing or failed builds.Jan 14 2021, 10:37 AM
This revision was automatically updated to reflect the committed changes.