This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Make sure std::allocator<void> is always trivial
ClosedPublic

Authored by ldionne on Jun 17 2021, 1:19 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

When we removed the allocator<void> specialization, the triviality of
std::allocator<void> changed because the primary template had a
non-trivial default constructor and the specialization didn't
(so std::allocator<void> went from trivial to non-trivial).

This commit fixes that oversight by giving a trivial constructor to
the primary template when instantiated on cv-void.

This was reported in https://llvm.org/PR50299.

(cherry picked from commit 71e4d434dc83b02a853712a5cb026ee2fa9ba67f)

Diff Detail

Event Timeline

ldionne requested review of this revision.Jun 17 2021, 1:19 PM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2021, 1:19 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Jun 22 2021, 9:05 AM
This revision is now accepted and ready to land.Jun 22 2021, 9:05 AM
ldionne closed this revision.Jun 22 2021, 9:05 AM
commit 275ffa580880f6e18bf9742cad8e5dcab67b1f1d
Author: Louis Dionne <ldionne.2@gmail.com>
Date:   Wed Jun 16 12:35:00 2021 -0400

    [libc++] Make sure std::allocator<void> is always trivial

    When we removed the allocator<void> specialization, the triviality of
    std::allocator<void> changed because the primary template had a
    non-trivial default constructor and the specialization didn't
    (so std::allocator<void> went from trivial to non-trivial).

    This commit fixes that oversight by giving a trivial constructor to
    the primary template when instantiated on cv-void.

    This was reported in https://llvm.org/PR50299.

    (cherry picked from commit 71e4d434dc83b02a853712a5cb026ee2fa9ba67f)

    Differential Revision: https://reviews.llvm.org/D104486