This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters
ClosedPublic

Authored by lebedev.ri on Jan 20 2020, 1:54 AM.

Details

Summary

I kind-of understand why it is restricted to integer-typed arguments,
for general enum's the value passed is not nessesairly the alignment implied,
although one might say that user would know best.

But we clearly should whitelist std::align_val_t,
which is just a thin wrapper over std::size_t,
and is the C++ standard way of specifying alignment.

Diff Detail

Event Timeline

lebedev.ri created this revision.Jan 20 2020, 1:54 AM

NFC, more tests.

erichkeane accepted this revision.Jan 23 2020, 9:25 AM

This makes a lot of sense to me.

This revision is now accepted and ready to land.Jan 23 2020, 9:25 AM

This makes a lot of sense to me.

Thank you for the review!

Rebased, NFC.

This revision was automatically updated to reflect the committed changes.