mirror of
https://github.com/boostorg/config.git
synced 2025-07-31 21:04:28 +02:00
Add more constexpr tests
MSVC 14 RC currently passes the constexpr tests, but fails to compile Boost if BOOST_NO_CXX11_CONSTEXPR is not defined. Added three tests that clang can compile in C++11 mode, but MSVC cannot.
This commit is contained in:
@@ -36,6 +36,32 @@ constexpr const A a = 42;
|
|||||||
|
|
||||||
X<a> xx; // OK: unique conversion to int
|
X<a> xx; // OK: unique conversion to int
|
||||||
|
|
||||||
|
// virtual function
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
virtual void vf() {}
|
||||||
|
};
|
||||||
|
struct C : B
|
||||||
|
{
|
||||||
|
constexpr C() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// aggregate initialization
|
||||||
|
struct D
|
||||||
|
{
|
||||||
|
int val[2];
|
||||||
|
constexpr D() : val() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// virtual base
|
||||||
|
struct E
|
||||||
|
{
|
||||||
|
};
|
||||||
|
struct F : virtual E
|
||||||
|
{
|
||||||
|
};
|
||||||
|
constexpr F& f(F& out) { return out; }
|
||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
int i = square(5);
|
int i = square(5);
|
||||||
|
Reference in New Issue
Block a user