SuccessChanges

Summary

  1. DR2064: decltype(E) is only a dependent type if E is type-dependent, not (details)
  2. PR24076, PR33655, C++ CWG 1558: Consider the instantiation-dependence of (details)
  3. Following up on PR48517, fix handling of template arguments that refer (details)
  4. [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (details)
Commit e3065ce238475ec202c707f4c58d90df171626ca by richard
DR2064: decltype(E) is only a dependent type if E is type-dependent, not
if E is merely instantiation-dependent.

Previously reverted in 34e72a146111dd986889a0f0ec8767b2ca6b2913;
re-committed with a fix to an issue that caused name mangling to assert.
The file was modifiedclang/include/clang/AST/DependenceFlags.h
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/test/SemaCXX/invalid-template-base-specifier.cpp
The file was modifiedclang/test/SemaTemplate/dependent-expr.cpp
The file was modifiedclang/test/SemaTemplate/temp_arg_template_cxx1z.cpp
The file was modifiedclang/lib/AST/ItaniumMangle.cpp
The file was modifiedclang/test/Sema/invalid-bitwidth-expr.mm
The file was modifiedclang/test/CXX/drs/dr20xx.cpp
The file was modifiedclang/lib/AST/Type.cpp
The file was modifiedclang/www/cxx_dr_status.html
The file was modifiedclang/test/CodeGenCXX/mangle-subst.cpp
Commit fbb83f18b5485218ad3c36c1d079c89f061372b8 by richard
PR24076, PR33655, C++ CWG 1558: Consider the instantiation-dependence of
the nested-name-specifier when determining whether a qualified type is
instantiation-dependent.

Previously reverted in 25a02c3d1a688d3cd18faef96c75fa553efbbac7 due to
causing us to reject some code. It turns out that the rejected code was
ill-formed (no diagnostic required).
The file was modifiedclang/www/cxx_dr_status.html
The file was modifiedclang/include/clang/AST/Type.h
The file was modifiedclang/lib/AST/ItaniumMangle.cpp
The file was addedclang/test/SemaTemplate/instantiation-dependence.cpp
The file was modifiedclang/test/SemaTemplate/partial-spec-instantiate.cpp
The file was modifiedclang/test/CXX/drs/dr15xx.cpp
The file was modifiedclang/test/CodeGenCXX/mangle-template.cpp
Commit 5a391d38ac6c561ba908334d427f26124ed9132e by richard
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.

Previously committed as 8c1f2d15b826591cdf6bd6b468b8a7d23377b29e, and
reverted because a dependency commit was reverted.
The file was modifiedclang/lib/AST/ComputeDependence.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_dist_schedule_messages.cpp
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/test/OpenMP/target_update_from_messages.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/test/SemaCXX/warn-unused-lambda-capture.cpp
The file was modifiedclang/test/OpenMP/distribute_simd_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/target_update_to_messages.cpp
The file was removedclang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
The file was modifiedclang/lib/AST/ExprCXX.cpp
The file was modifiedclang/test/OpenMP/distribute_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/task_messages.cpp
The file was modifiedclang/lib/AST/TemplateBase.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_dist_schedule_messages.cpp
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
The file was modifiedclang/include/clang/AST/Expr.h
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_dist_schedule_messages.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiate.cpp
The file was modifiedclang/test/OpenMP/target_simd_collapse_messages.cpp
The file was modifiedclang/lib/AST/ExprConstant.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp
The file was addedclang/test/SemaTemplate/temp_arg_nontype_cxx17.cpp
The file was modifiedclang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_dist_schedule_messages.cpp
The file was modifiedclang/lib/AST/Expr.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_dist_schedule_messages.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp
The file was modifiedclang/include/clang/AST/TemplateBase.h
Commit 4b574008aef5a7235c1f894ab065fe300d26e786 by richard
[c++20] P1907R1: Support for generalized non-type template arguments of scalar type.

Previously committed as 9e08e51a20d0d2b1c5724bb17e969d036fced4cd, and
reverted because a dependency commit was reverted. This incorporates the
following follow-on commits that were also reverted:

7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0 by Simon Pilgrim
ed13d8c66781b50ff007cb089c5905f9bb9e8af2 by me
95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc by Sam McCall
430d5d8429473c2b10b109991d7577a3cea41140 by Dave Zarzycki
The file was modifiedclang-tools-extra/clangd/DumpAST.cpp
The file was modifiedclang/lib/AST/StmtProfile.cpp
The file was modifiedclang/lib/AST/TemplateBase.cpp
The file was modifiedclang/lib/Index/USRGeneration.cpp
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/include/clang/AST/RecursiveASTVisitor.h
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/lib/CodeGen/CGExprConstant.cpp
The file was modifiedclang/lib/Sema/SemaLookup.cpp
The file was modifiedclang/include/clang/AST/ASTContext.h
The file was modifiedclang/tools/libclang/CXCursor.cpp
The file was modifiedclang/test/SemaTemplate/temp_arg_nontype_cxx17.cpp
The file was modifiedclang/lib/Sema/SemaTemplateVariadic.cpp
The file was modifiedclang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
The file was modifiedclang/lib/AST/ASTStructuralEquivalence.cpp
The file was modifiedclang/lib/AST/ItaniumMangle.cpp
The file was modifiedclang/test/CodeGenCXX/mangle-ms-templates.cpp
The file was modifiedclang/lib/AST/ODRHash.cpp
The file was modifiedlldb/include/lldb/lldb-enumerations.h
The file was modifiedclang/lib/Sema/SemaTemplateDeduction.cpp
The file was modifiedclang/include/clang/AST/TemplateArgumentVisitor.h
The file was modifiedclang/lib/AST/ASTImporter.cpp
The file was modifiedclang/lib/AST/MicrosoftMangle.cpp
The file was addedclang/test/CodeGenCXX/template-arguments.cpp
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedclang/test/CodeGenCXX/mangle-template.cpp
The file was modifiedclang/lib/AST/Decl.cpp
The file was modifiedclang/lib/AST/TypeLoc.cpp
The file was modifiedclang/include/clang/AST/PropertiesBase.td
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiate.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.cpp
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/lib/Sema/TreeTransform.h
The file was modifiedclang-tools-extra/clangd/index/remote/Client.cpp
The file was modifiedclang/include/clang/AST/TemplateBase.h