ojhunt wrote:

> > > MSVC always uses 64-bit `long double`. I don't know anything about 
> > > attempts to use 80-bit `long double` on Windows except that they're 
> > > asking for tons of complexity.

> > would that be expected to work?
> 
> Yes, with this patch, `std::array<Klass, overaligned_type>` works correctly 
> and gets the proper alignment even with `#pragma pack`.

That is an incorrect statement. The alignment "works" in your test case, that 
does not make it correct.

You've made a serious change to the layout of the object that has no existing 
precedence and does not match behavior anywhere else. It seems like the correct 
fix for your testcase is for the _code_ to explicitly annotate the long double 
that is being compiled with an alignment annotation, because it's doing 
something that does not conform to the platform ABI.

I would argue if anything the bug is clang making an incorrect alignment 
assumption for a field in a packed struct.



https://github.com/llvm/llvm-project/pull/208256
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to