================
@@ -460,24 +460,30 @@ def run(self) -> None:
def expand_std(std: str) -> List[str]:
- split_std, or_later, _ = std.partition("-or-later")
-
- if not or_later:
- return [split_std]
-
- for standard_list in (CPP_STANDARDS, C_STANDARDS):
- item = next(
- (
- i
- for i, v in enumerate(standard_list)
- if (split_std in v if isinstance(v, (list, tuple)) else
split_std == v)
- ),
- None,
- )
- if item is not None:
- return [split_std] + [
- x if isinstance(x, str) else x[0] for x in standard_list[item
+ 1 :]
- ]
+ split_std, or_later, suffix = std.partition("-or-later")
+
+ if or_later:
+ if suffix:
+ # Keep malformed -or-later spellings unchanged so clang diagnoses
them.
+ return [std]
----------------
vbvictor wrote:
I'm +1 on reducing nesting.
I think previous version was just fine, I personally wanted just to reorder two
if's and add a comment.
https://github.com/llvm/llvm-project/pull/195609
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits