rnk added a comment.
Thanks, this seems like the right spot.
================
Comment at: clang/lib/Sema/SemaTemplate.cpp:9767
+ if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
+ Def->hasAttr<MSInheritanceAttr>()) {
----------------
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.
================
Comment at: clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp:151-159
+namespace pr48687 {
+template <typename T> struct A {
+ T value;
+ static constexpr auto address = &A<T>::value;
+};
+extern template class A<float>;
+template class A<float>;
----------------
zequanwu wrote:
> zequanwu wrote:
> > 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.
> >
> NVM, the align should be 4.
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.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94646/new/
https://reviews.llvm.org/D94646
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits