This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Work around a bug in older compiler versions.
ClosedPublic

Authored by lhames on Oct 25 2018, 12:43 PM.

Details

Summary

This patch works around a bug in clang-3.8 that made some uses of the DenseMap initializer list constructor ambiguous. The bug seems to be related to inheriting constructors, so this fix explicitly declares the necessary DenseMapPair constructors.

With my local clang-3.8 build, this change fixes the issue at http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/33980/steps/build-unified-tree/logs/stdio.

Hopefully it will also fix the X-ray bugs we have seen on other builders.

Diff Detail

Event Timeline

lhames created this revision.Oct 25 2018, 12:43 PM

Oops -- forgot to clang-format this. Will do so before applying if it is accepted though.

Patch description doesn't seem to immediately relate to the change - nor test cases demonstrating the connection?

lhames updated this revision to Diff 171195.Oct 25 2018, 2:08 PM
  • Add non templated constructors for DenseMap, clarify clang version in comment.
  • clang-format
lhames retitled this revision from [ADT] Add initializer_list constructor, equality tests for DenseMap/DenseSet. to [ADT] Work around a bug in older compiler versions..Oct 25 2018, 2:13 PM
lhames edited the summary of this revision. (Show Details)

Patch description doesn't seem to immediately relate to the change - nor test cases demonstrating the connection?

Yep. I fail at 'arc diff' apparently. It seems to have dug up a message from a previous revision.

There is no test case for this issue, as it is a compile failure on currently supported compilers.

Patch description doesn't seem to immediately relate to the change - nor test cases demonstrating the connection?

Yep. I fail at 'arc diff' apparently. It seems to have dug up a message from a previous revision.

There is no test case for this issue, as it is a compile failure on currently supported compilers.

Ah, cool cool - I see the updated description & such. Makes sense - I'll leave this to @dberris to check on, since he's probably got more context on what the xray buildbots are running, etc.

lhames updated this revision to Diff 171197.Oct 25 2018, 2:23 PM
  • Fix a missing &&

Looks promising. I will apply locally this afternoon/evening, and report back.

Works for me! Thanks. Dean?

dberris accepted this revision.Oct 26 2018, 7:08 AM

LGTM -- thanks!

This revision is now accepted and ready to land.Oct 26 2018, 7:08 AM
lhames accepted this revision.Oct 26 2018, 11:55 AM

Thanks everyone! Committed in r345411.

lhames closed this revision.Oct 26 2018, 11:55 AM