diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-08-29 11:26:16 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-09 17:50:59 +0000 |
commit | 34d424aab432bfb3e0d599ba3ee659b6c7c4a907 (patch) | |
tree | 996a1ff13b5048b1ad13c6ebc0615eaa6c843f8b | |
parent | bc576a1348d026e5a8653bfed9447b98c7a20a4f (diff) |
Cope with the new alias for noexcept
We can now have Q_DECL_NOTHROW converted to Q_DECL_NOEXCEPT, or either
of these converted to noexcept. A later commit shall also deal with
Q_DECL_NOEXCEPT_EXPR(), which shall need to happen before this (as it
also turns into noexpr(), albeit with parentheses). Combine with the
other three-step cascade and move both later than it was.
Change-Id: I11b78af9a6eb0948990e4ba50f702c4f93739bb6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rwxr-xr-x | packaging-tools/resetboring.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/packaging-tools/resetboring.py b/packaging-tools/resetboring.py index a9f01e8c6..263b42091 100755 --- a/packaging-tools/resetboring.py +++ b/packaging-tools/resetboring.py @@ -617,7 +617,7 @@ class Selector(object): # Select interesting changes, discard boring. for pair in (('Q_QDOC', 'Q_CLANG_QDOC'), ('Q_DECL_FINAL', 'final'), ('Q_DECL_CONSTEXPR', 'constexpr'), - ('Q_DECL_NOTHROW', 'noexcept')): + ): def test(words, k=pair[1]): return k in words def purge(words, p=pair): @@ -653,14 +653,6 @@ class Selector(object): # Select interesting changes, discard boring. # but the brace-matching is a bit much for this parser; and it # tends to get split across lines anyway ... - # Synonyms for 0: - for key in ('Q_NULLPTR', 'nullptr'): - def test(words, z=key): - return z in words - def purge(words, z=key): - return [('0', 'Q_NULLPTR', 'nullptr') if w == z else w for w in words] - yield test, purge - # Filter out various common end-of-line comments: for sought in (('//', '=', 'default'), ('//', 'LCOV_EXCL_LINE')): def test(tokens, sought=sought, size=len(sought)): @@ -705,6 +697,18 @@ class Selector(object): # Select interesting changes, discard boring. return words yield test, purge + # Multi-step transitions (oldest first in each tuple): + for seq in (('0', 'Q_NULLPTR', 'nullptr'), + # Needs to happen after handling of Q_DECL_NOEXCEPT_EXPR(): + ('Q_DECL_NOTHROW', 'Q_DECL_NOEXCEPT', 'noexcept'), + ): + for key in seq[1:]: + def test(words, z=key): + return z in words + def purge(words, z=key, s=seq): + return [s if w == z else w for w in words] + yield test, purge + # Used by next two #if-ery mungers: def find(words, key): assert None in key # so result *does* get set if we succeed |