[all-commits] [llvm/llvm-project] 08ba9c: Suppress Deferred Diagnostics in discarded stateme...

Erich Keane via All-commits all-commits at lists.llvm.org
Wed May 12 12:49:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 08ba9ce1ef7214623d4104e72d817c73644a0884
      https://github.com/llvm/llvm-project/commit/08ba9ce1ef7214623d4104e72d817c73644a0884
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2021-05-12 (Wed, 12 May 2021)

  Changed paths:
    M clang/include/clang/AST/EvaluatedExprVisitor.h
    M clang/include/clang/AST/Stmt.h
    M clang/lib/AST/Stmt.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/test/SemaCUDA/deferred-diags.cu

  Log Message:
  -----------
  Suppress Deferred Diagnostics in discarded statements.

It doesn't really make sense to emit language specific diagnostics
in a discarded statement, and suppressing these diagnostics results in a
programming pattern that many users will feel is quite useful.

Basically, this makes sure we only emit errors from the 'true' side of a
'constexpr if'.

It does this by making the ExprEvaluatorBase type have an opt-in option
as to whether it should visit discarded cases.

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




More information about the All-commits mailing list