[all-commits] [llvm/llvm-project] 8c1f2d: Following up on PR48517, fix handling of template ...

Richard Smith via All-commits all-commits at lists.llvm.org
Thu Dec 17 23:55:07 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c1f2d15b826591cdf6bd6b468b8a7d23377b29e
      https://github.com/llvm/llvm-project/commit/8c1f2d15b826591cdf6bd6b468b8a7d23377b29e
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-12-17 (Thu, 17 Dec 2020)

  Changed paths:
    M clang/include/clang/AST/Expr.h
    M clang/include/clang/AST/TemplateBase.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ComputeDependence.cpp
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ExprCXX.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/AST/TemplateBase.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/OpenMP/distribute_dist_schedule_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_dist_schedule_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_dist_schedule_messages.cpp
    M clang/test/OpenMP/distribute_simd_dist_schedule_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp
    M clang/test/OpenMP/target_simd_collapse_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_dist_schedule_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_dist_schedule_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_dist_schedule_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_dist_schedule_messages.cpp
    M clang/test/OpenMP/target_update_from_messages.cpp
    M clang/test/OpenMP/target_update_to_messages.cpp
    M clang/test/OpenMP/task_messages.cpp
    M clang/test/OpenMP/teams_distribute_dist_schedule_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_dist_schedule_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_dist_schedule_messages.cpp
    M clang/test/OpenMP/teams_distribute_simd_dist_schedule_messages.cpp
    M clang/test/SemaCXX/warn-unused-lambda-capture.cpp
    A clang/test/SemaTemplate/temp_arg_nontype_cxx17.cpp
    R clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
    M clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp

  Log Message:
  -----------
  Following up on PR48517, fix handling of template arguments that refer
to dependent declarations.

Treat an id-expression that names a local variable in a templated
function as being instantiation-dependent.

This addresses a language defect whereby a reference to a dependent
declaration can be formed without any construct being value-dependent.
Fixing that through value-dependence turns out to be problematic, so
instead this patch takes the approach (proposed on the core reflector)
of allowing the use of pointers or references to (but not values of)
dependent declarations inside value-dependent expressions, and instead
treating template arguments as dependent if they evaluate to a constant
involving such dependent declarations.

This ends up affecting a bunch of OpenMP tests, due to OpenMP
imprecisely handling instantiation-dependent constructs, bailing out
early instead of processing dependent constructs to the extent possible
when handling the template.




More information about the All-commits mailing list