Commit ba6111f9 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Skip some is_constexpr_default_constructible tests under gcc7 (#1273)

Summary:
Pull Request resolved: https://github.com/facebook/folly/pull/1273

[Folly] Skip some `is_constexpr_default_constructible` tests under gcc7.

In gcc7 specifically, i.e. not gcc6 and not gcc8, some of the expectations fail. The compiler is wrong and this affects the outcome of `is_constexpr_default_constructible`, but this is mostly harmless as far as existing uses go. Fix the tests by skipping them when using gcc7.

Reviewed By: vitaut

Differential Revision: D18820312

fbshipit-source-id: a2d0d53ed2716fffba7840e2b167e9ad4ac012ff
parent 1d485af8
......@@ -403,6 +403,8 @@ TEST(Traits, is_instantiation_of) {
}
TEST(Traits, is_constexpr_default_constructible) {
constexpr auto const broken = kGnuc == 7 && !kIsClang;
EXPECT_TRUE(is_constexpr_default_constructible_v<int>);
struct Empty {};
......@@ -411,7 +413,7 @@ TEST(Traits, is_constexpr_default_constructible) {
struct NonTrivialDtor {
~NonTrivialDtor() {}
};
EXPECT_FALSE(is_constexpr_default_constructible_v<NonTrivialDtor>);
EXPECT_FALSE(is_constexpr_default_constructible_v<NonTrivialDtor> && !broken);
struct ConstexprCtor {
int x, y;
......@@ -423,7 +425,8 @@ TEST(Traits, is_constexpr_default_constructible) {
int x, y;
NonConstexprCtor() noexcept : x(7), y(11) {}
};
EXPECT_FALSE(is_constexpr_default_constructible_v<NonConstexprCtor>);
EXPECT_FALSE(
is_constexpr_default_constructible_v<NonConstexprCtor> && !broken);
struct NoDefaultCtor {
constexpr NoDefaultCtor(int, int) noexcept {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment