[clang] b58ed43 - Revert "[clang] Fix a crash in constant evaluation"

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 31 06:19:25 PDT 2022


On Wed, Aug 31, 2022 at 4:13 AM Kadir Cetinkaya via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
>
> Author: Kadir Cetinkaya
> Date: 2022-08-31T10:12:52+02:00
> New Revision: b58ed43a7f6b67bdb03ab746b654c823f54c261f
>
> URL: https://github.com/llvm/llvm-project/commit/b58ed43a7f6b67bdb03ab746b654c823f54c261f
> DIFF: https://github.com/llvm/llvm-project/commit/b58ed43a7f6b67bdb03ab746b654c823f54c261f.diff
>
> LOG: Revert "[clang] Fix a crash in constant evaluation"
>
> This reverts commit a5ab650714d05c2e49ec158dc99156118a893027.

Thank you for the revert, but next time, can you please add
information to the commit message as to why the revert is happening?
That helps us out a bunch when we're doing git blames to see how
changes made it into or out of the project. Thanks!

~Aaron

>
> Added:
>
>
> Modified:
>     clang/lib/AST/ExprConstant.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
> index 2b1a30f8354fb..3df0e4292b6ca 100644
> --- a/clang/lib/AST/ExprConstant.cpp
> +++ b/clang/lib/AST/ExprConstant.cpp
> @@ -4794,11 +4794,6 @@ static bool getDefaultInitValue(QualType T, APValue &Result) {
>        Result = APValue((const FieldDecl *)nullptr);
>        return true;
>      }
> -    // Can't access properties of an incomplete type.
> -    if (!RD->hasDefinition()) {
> -      Result = APValue();
> -      return false;
> -    }
>      Result = APValue(APValue::UninitStruct(), RD->getNumBases(),
>                       std::distance(RD->field_begin(), RD->field_end()));
>
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list