[all-commits] [llvm/llvm-project] 73c12b: [Concepts] Fix a deserialization crash.

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Jul 30 00:27:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 73c12bd8ff1a9cd8375a357ea06f171e127ec1b8
      https://github.com/llvm/llvm-project/commit/73c12bd8ff1a9cd8375a357ea06f171e127ec1b8
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M clang/lib/Serialization/ASTReaderDecl.cpp
    A clang/test/PCH/cxx2a-constraints-crash.cpp

  Log Message:
  -----------
  [Concepts] Fix a deserialization crash.

`TemplateTypeParmDecl::hasTypeConstraint` is not a safe guard for
checking `TemplateTypeParmDecl::getTypeConstraint()` result is null.

in somecases (e.g. implicit deduction guide templates synthesized from the
constructor, immediately-declared constraint is not formed because of an error),
hasTypeConstraint returns false, and getTypeConstraint returns a nullptr.

Fix https://bugs.llvm.org/show_bug.cgi?id=46790

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




More information about the All-commits mailing list