[all-commits] [llvm/llvm-project] c88500: [Modules] Don't const eval VarDecls with dependent...

Henrik G. Olsson via All-commits all-commits at lists.llvm.org
Mon Jul 7 16:02:02 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8850051c2414b899416e16222f5d96e854be563
      https://github.com/llvm/llvm-project/commit/c8850051c2414b899416e16222f5d96e854be563
  Author: Henrik G. Olsson <hnrklssn at gmail.com>
  Date:   2025-07-07 (Mon, 07 Jul 2025)

  Changed paths:
    M clang/lib/AST/Decl.cpp
    A clang/test/Modules/var-init-side-effects-templated.cpp

  Log Message:
  -----------
  [Modules] Don't const eval VarDecls with dependent type (#147378)

EvaluateAsInitializer does not support evaluating values with dependent
types. This was previously guarded with a check for the initializer
expression, but it is possible for the VarDecl to have a dependent type
without the initializer having a dependent type, when the initializer is
a specialized template type and the VarDecl has the unspecialized type.
This adds a guard checking for dependence in the VarDecl type as well.
This fixes the issue raised by Google in
https://github.com/llvm/llvm-project/pull/145447



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list