This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Conditionally workaround C1XX/EDG bugs
ClosedPublic

Authored by CaseyCarter on May 2 2017, 5:52 PM.

Details

Summary

Test support machinery changes needed to parse with EDG and compile with C1XX's /Za flag that disables MS extensions.

I try to make changes to <optional> and the optional/variant tests simultaneously in the MS STL and in libc++, which realistically requires that I keep the tests largely synchronized between libc++ and our internal test suite. As a first step toward automating that integration, I'd like to upstream this patch.

This change works around a couple of bugs:

  1. EDG doesn't like explicit constexpr in a derived class. This program:
struct Base {};

struct Derived : Base {
    constexpr Derived() = default;
};

triggers "error: defaulted default constructor cannot be constexpr."

  1. C1XX with /Za has no idea which constructor needs to be valid for copy elision.

The change also conditionally disables parts of the msvc_stdlib_force_include.hpp header that conflict with external configuration when _LIBCXX_IN_DEVCRT is defined.

Diff Detail

Repository
rL LLVM

Event Timeline

CaseyCarter created this revision.May 2 2017, 5:52 PM
STL_MSFT accepted this revision.May 2 2017, 6:12 PM
STL_MSFT added inline comments.
test/support/archetypes.hpp
20 ↗(On Diff #97530)

I think that this comment doesn't match the ifndef check, but it's a style question.

test/support/archetypes.ipp
10 ↗(On Diff #97530)

Should you define it to be inline instead of nothing?

This revision is now accepted and ready to land.May 2 2017, 6:12 PM
CaseyCarter added inline comments.May 2 2017, 6:18 PM
test/support/archetypes.hpp
20 ↗(On Diff #97530)

I know which style *I* prefer, because I wrote it, and I know which style *you* prefer, because you commented. I'll change this when Marshall or Eric let me know what they prefer here.

test/support/archetypes.ipp
10 ↗(On Diff #97530)

This macro is typically defined to either constexpr or nothing - see the definitions in archetypes.hpp above.

This revision was automatically updated to reflect the committed changes.