From 4ec6a18686c5814dca17b047898226cfa7306c9b Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Tue, 5 May 2015 11:46:28 +0200 Subject: [PATCH] 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. --- test/boost_no_constexpr.ipp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/boost_no_constexpr.ipp b/test/boost_no_constexpr.ipp index 563bdb20..5084ae03 100644 --- a/test/boost_no_constexpr.ipp +++ b/test/boost_no_constexpr.ipp @@ -36,6 +36,32 @@ constexpr const A a = 42; X 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 i = square(5);