OSDN Git Service

TrailingObjects::FixedSizeStorage constexpr fixes + tests
authorHubert Tong <hubert.reinterpretcast@gmail.com>
Sat, 30 Jul 2016 14:01:00 +0000 (14:01 +0000)
committerHubert Tong <hubert.reinterpretcast@gmail.com>
Sat, 30 Jul 2016 14:01:00 +0000 (14:01 +0000)
commitb80ca8647e5b7c1d697be92ad371038d189b3e2d
treee0595bc6240425bd114663d3d2b3f725e9cbed5b
parentf84abb4f620b3bb5c650ca4b878dfa346d4b38ea
TrailingObjects::FixedSizeStorage constexpr fixes + tests

Summary:
This change fixes issues with `LLVM_CONSTEXPR` functions and
`TrailingObjects::FixedSizeStorage`. In particular, some of the
functions marked `LLVM_CONSTEXPR` used by `FixedSizeStorage` were not
implemented such that they evaluate successfully as part of a constant
expression despite constant arguments.

This change also implements a more traditional template-meta path to
accommodate MSVC, and adds unit tests for `FixedSizeStorage`.

Drive-by fix: the access control for members of `TrailingObjectsImpl` is
tightened.

Reviewers: faisalv, rsmith, aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277270 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/AlignOf.h
include/llvm/Support/MathExtras.h
include/llvm/Support/TrailingObjects.h
unittests/Support/TrailingObjectsTest.cpp