[all-commits] [llvm/llvm-project] 6f3393: Explain why the array bound is non-constant in VLA...

Richard Smith via All-commits all-commits at lists.llvm.org
Wed Aug 19 15:46:13 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f339367195e7464df87571062529bbe20157bdf
      https://github.com/llvm/llvm-project/commit/6f339367195e7464df87571062529bbe20157bdf
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-08-19 (Wed, 19 Aug 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/test/CXX/drs/dr0xx.cpp
    M clang/test/CXX/drs/dr3xx.cpp
    M clang/test/CXX/drs/dr4xx.cpp
    M clang/test/CXX/expr/expr.const/p2-0x.cpp
    M clang/test/CXX/expr/expr.const/p5-0x.cpp
    M clang/test/OpenMP/atomic_messages.c
    M clang/test/OpenMP/critical_messages.cpp
    M clang/test/OpenMP/declare_simd_messages.cpp
    M clang/test/OpenMP/distribute_collapse_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_collapse_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c
    M clang/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp
    M clang/test/OpenMP/distribute_simd_aligned_messages.cpp
    M clang/test/OpenMP/distribute_simd_collapse_messages.cpp
    M clang/test/OpenMP/distribute_simd_misc_messages.c
    M clang/test/OpenMP/distribute_simd_safelen_messages.cpp
    M clang/test/OpenMP/distribute_simd_simdlen_messages.cpp
    M clang/test/OpenMP/for_collapse_messages.cpp
    M clang/test/OpenMP/for_misc_messages.c
    M clang/test/OpenMP/for_ordered_clause.cpp
    M clang/test/OpenMP/for_simd_aligned_messages.cpp
    M clang/test/OpenMP/for_simd_collapse_messages.cpp
    M clang/test/OpenMP/for_simd_misc_messages.c
    M clang/test/OpenMP/for_simd_safelen_messages.cpp
    M clang/test/OpenMP/for_simd_simdlen_messages.cpp
    M clang/test/OpenMP/master_taskloop_collapse_messages.cpp
    M clang/test/OpenMP/master_taskloop_misc_messages.c
    M clang/test/OpenMP/master_taskloop_simd_aligned_messages.cpp
    M clang/test/OpenMP/master_taskloop_simd_collapse_messages.cpp
    M clang/test/OpenMP/master_taskloop_simd_misc_messages.c
    M clang/test/OpenMP/master_taskloop_simd_safelen_messages.cpp
    M clang/test/OpenMP/master_taskloop_simd_simdlen_messages.cpp
    M clang/test/OpenMP/ordered_messages.cpp
    M clang/test/OpenMP/parallel_for_collapse_messages.cpp
    M clang/test/OpenMP/parallel_for_misc_messages.c
    M clang/test/OpenMP/parallel_for_ordered_messages.cpp
    M clang/test/OpenMP/parallel_for_simd_aligned_messages.cpp
    M clang/test/OpenMP/parallel_for_simd_collapse_messages.cpp
    M clang/test/OpenMP/parallel_for_simd_misc_messages.c
    M clang/test/OpenMP/parallel_for_simd_safelen_messages.cpp
    M clang/test/OpenMP/parallel_for_simd_simdlen_messages.cpp
    M clang/test/OpenMP/parallel_master_taskloop_collapse_messages.cpp
    M clang/test/OpenMP/parallel_master_taskloop_misc_messages.c
    M clang/test/OpenMP/parallel_master_taskloop_simd_aligned_messages.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_collapse_messages.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_misc_messages.c
    M clang/test/OpenMP/parallel_master_taskloop_simd_safelen_messages.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_simdlen_messages.cpp
    M clang/test/OpenMP/simd_aligned_messages.cpp
    M clang/test/OpenMP/simd_collapse_messages.cpp
    M clang/test/OpenMP/simd_misc_messages.c
    M clang/test/OpenMP/simd_safelen_messages.cpp
    M clang/test/OpenMP/simd_simdlen_messages.cpp
    M clang/test/OpenMP/target_parallel_for_collapse_messages.cpp
    M clang/test/OpenMP/target_parallel_for_misc_messages.c
    M clang/test/OpenMP/target_parallel_for_ordered_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_misc_messages.c
    M clang/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp
    M clang/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp
    M clang/test/OpenMP/target_simd_aligned_messages.cpp
    M clang/test/OpenMP/target_simd_collapse_messages.cpp
    M clang/test/OpenMP/target_simd_misc_messages.c
    M clang/test/OpenMP/target_simd_safelen_messages.cpp
    M clang/test/OpenMP/target_simd_simdlen_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_collapse_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_misc_messages.c
    M clang/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c
    M clang/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp
    M clang/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp
    M clang/test/OpenMP/taskloop_collapse_messages.cpp
    M clang/test/OpenMP/taskloop_misc_messages.c
    M clang/test/OpenMP/taskloop_simd_aligned_messages.cpp
    M clang/test/OpenMP/taskloop_simd_collapse_messages.cpp
    M clang/test/OpenMP/taskloop_simd_misc_messages.c
    M clang/test/OpenMP/taskloop_simd_safelen_messages.cpp
    M clang/test/OpenMP/taskloop_simd_simdlen_messages.cpp
    M clang/test/OpenMP/teams_distribute_collapse_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp
    M clang/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
    M clang/test/OpenMP/teams_distribute_simd_collapse_messages.cpp
    M clang/test/OpenMP/teams_distribute_simd_safelen_messages.cpp
    M clang/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp
    M clang/test/PCH/cxx-constexpr.cpp
    M clang/test/Sema/bitfield.c
    M clang/test/Sema/c89.c
    M clang/test/Sema/complex-int.c
    M clang/test/Sema/warn-vla.c
    M clang/test/SemaCXX/c99-variable-length-array-cxx11.cpp
    M clang/test/SemaCXX/c99-variable-length-array.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constant-expression.cpp
    R clang/test/SemaCXX/vla-consruct.cpp
    A clang/test/SemaCXX/vla-construct.cpp
    M clang/test/SemaCXX/warn-vla.cpp
    M clang/test/SemaObjC/class-bitfield.m
    M clang/test/SemaTemplate/instantiate-self.cpp

  Log Message:
  -----------
  Explain why the array bound is non-constant in VLA diagnostics.

In passing, also use a more precise diagnostic to explain why an
expression is not an ICE if it's not of integral type.


  Commit: c1c1bed5d0828f1905f1e9a09a32c02f05de9b41
      https://github.com/llvm/llvm-project/commit/c1c1bed5d0828f1905f1e9a09a32c02f05de9b41
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-08-19 (Wed, 19 Aug 2020)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/test/SemaCXX/cxx1y-contextual-conversion-tweaks.cpp

  Log Message:
  -----------
  [c++14] Implement missed piece of N3323: use "converted constant" rules
for array bounds, not "integer constant" rules.

For an array bound of class type, this causes us to perform an implicit
conversion to size_t, instead of looking for a unique conversion to
integral or unscoped enumeration type. This affects which cases are
valid when a class has multiple implicit conversion functions to
different types.


Compare: https://github.com/llvm/llvm-project/compare/09ca3f41bbc5...c1c1bed5d082


More information about the All-commits mailing list