This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Ensure Sort include is stable with negative Priority
AbandonedPublic

Authored by jeanphilippeD on Dec 18 2015, 5:23 AM.

Details

Reviewers
djasper
Summary

The new sort include with negative priority was not stable when running it again over the updated includes.

Extend the test NegativePriorities to have an extra header. Test pas still passing
Add a new assertion to test that the sorting is stable. This new assertion failed.

From this:
#include "important_os_header.h"
#include "c_main_header.h"
#include "a_other_header.h"

Before fix:
#include "important_os_header.h"
#include "a_other_header.h"
#include "c_main_header.h"

After fix:
#include "important_os_header.h"
#include "c_main_header.h"
#include "a_other_header.h"

Diff Detail

Event Timeline

jeanphilippeD retitled this revision from to [clang-format] Ensure Sort include is stable with negative Priority .
jeanphilippeD updated this object.
jeanphilippeD added a reviewer: djasper.
jeanphilippeD added a subscriber: cfe-commits.
jeanphilippeD abandoned this revision.Dec 31 2015, 5:01 AM

This was fixed by other patch.