[all-commits] [llvm/llvm-project] 96b8fd: Set InvalidDecl directly when deserializing a Decl
Aaron Puchert via All-commits
all-commits at lists.llvm.org
Mon Sep 7 11:02:51 PDT 2020
Branch: refs/heads/release/11.x
Home: https://github.com/llvm/llvm-project
Commit: 96b8fd70d1572d3d38abce208e855c49f9eeac1d
https://github.com/llvm/llvm-project/commit/96b8fd70d1572d3d38abce208e855c49f9eeac1d
Author: Aaron Puchert <aaronpuchert at alice-dsl.net>
Date: 2020-09-07 (Mon, 07 Sep 2020)
Changed paths:
M clang/lib/Serialization/ASTReaderDecl.cpp
M clang/test/PCH/cxx1z-decomposition.cpp
Log Message:
-----------
Set InvalidDecl directly when deserializing a Decl
When parsing a C++17 binding declaration, we first create the
BindingDecls in Sema::ActOnDecompositionDeclarator, and then build the
DecompositionDecl in Sema::ActOnVariableDeclarator, so the contained
BindingDecls are never null. But when deserializing, we read the
DecompositionDecl with all properties before filling in the Bindings.
Among other things, reading a declaration reads whether it's invalid,
then calling setInvalidDecl which assumes that all bindings of the
DecompositionDecl are available, but that isn't the case.
Deserialization should just set all properties directly without invoking
subsequent functions, so we just set the flag without using the setter.
Fixes PR34960.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D86207
(cherry picked from commit 16975a638df3cda95c677055120b23e689d96dcd)
More information about the All-commits
mailing list