[all-commits] [llvm/llvm-project] 56a872: Remove improper uses of DiagnosticErrorTrap and ha...

Richard Smith via All-commits all-commits at lists.llvm.org
Mon Jun 8 14:20:21 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 56a872947acca7635ca969f39f50062f2f779af0
      https://github.com/llvm/llvm-project/commit/56a872947acca7635ca969f39f50062f2f779af0
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-06-08 (Mon, 08 Jun 2020)

  Changed paths:
    M clang/include/clang/Basic/Diagnostic.h
    M clang/include/clang/Sema/Scope.h
    M clang/include/clang/Sema/ScopeInfo.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Frontend/FrontendActions.cpp
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/Parser/cxx2a-concepts-requires-expr.cpp

  Log Message:
  -----------
  Remove improper uses of DiagnosticErrorTrap and hasErrorOccurred.

DiagnosticErrorTrap is usually inappropriate because it indicates
whether an error message was rendered in a given region (and is
therefore affected by -ferror-limit and by suppression of errors if we
see an invalid declaration).

hasErrorOccurred() is usually inappropriate because it indicates
whethere an "error:" message was displayed, regardless of whether the
message was a warning promoted to an error, and therefore depends on
things like -Werror that are usually irrelevant.

Where applicable, CodeSynthesisContexts are used to attach notes to
the first diagnostic produced in a region of code, isnstead of using an
error trap and then attaching a note to whichever diagnostic happened to
be produced last (or suppressing the note if the final diagnostic is a
disabled warning!).

This is mostly NFC.




More information about the All-commits mailing list