This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Portability fix: add missing headers to unordered containers tests.
ClosedPublic

Authored by amakc11 on Nov 16 2018, 11:35 AM.

Details

Reviewers
EricWF
ldionne
Summary

A bunch of unordered containers tests call library functions, but don't directly include the corresponding header files:

  1. fabs() (defined in <cmath> which is not included);
  2. is_permutation() (defined in <algorithm> which is not included);
  3. next() (defined in <iterator> which is not included).

As a result, these tests won't compile against some conformant libraries.
Please note, that the list of the updated files might be incomplete, since I don't run "post C++11" tests.

Diff Detail

Repository
rCXX libc++

Event Timeline

amakc11 created this revision.Nov 16 2018, 11:35 AM
ldionne accepted this revision.Nov 16 2018, 11:37 AM

Thanks for the fix! Do you have commit access?

This revision is now accepted and ready to land.Nov 16 2018, 11:37 AM

No, I don't.

ldionne closed this revision.Nov 16 2018, 11:55 AM

Committed as r347085. Thanks!

test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp
22

Two things:

  1. Typo
  2. We like to order includes

I fixed those two things when I pushed the patch!