[all-commits] [llvm/llvm-project] cab3cf: [clang] Do not crash on "requires" after a fatal e...

Adam Czachorowski via All-commits all-commits at lists.llvm.org
Thu Jul 14 06:49:18 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cab3cfd013cf92c441c3acbfcc1844b267ab8659
      https://github.com/llvm/llvm-project/commit/cab3cfd013cf92c441c3acbfcc1844b267ab8659
  Author: Adam Czachorowski <adamcz at google.com>
  Date:   2022-07-14 (Thu, 14 Jul 2022)

  Changed paths:
    M clang/lib/Sema/SemaExprCXX.cpp
    A clang/test/SemaCXX/concept-fatal-error.cpp

  Log Message:
  -----------
  [clang] Do not crash on "requires" after a fatal error occurred.

The code would assume that SubstExpr() cannot fail on concept
specialization. This is incorret - we give up on some things after fatal
error occurred, since there's no value in doing futher work that the
user will not see anyway. In this case, this lead to crash.

The fatal error is simulated in tests with -ferror-limit=1, but this
could happen in other cases too.

Fixes https://github.com/llvm/llvm-project/issues/55401

Differential Revision: https://reviews.llvm.org/D129499




More information about the All-commits mailing list