[clang] fix error: cannot compile this l-value expression yet (#187755)

This commit is contained in:
Joe Kirchoff 2026-03-20 16:30:53 -07:00 committed by GitHub
parent 368f38b9fc
commit 335a2d0e7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View File

@ -402,6 +402,7 @@ Miscellaneous Clang Crashes Fixed
- Fixed a crash when subscripting a vector type with large unsigned integer values. (#GH180563)
- Fixed a crash when evaluating ``__is_bitwise_cloneable`` on invalid record types. (#GH183707)
- Fixed an assertion failure when casting a function pointer with a target with a non-default program address space. (#GH186210)
- Fixed a crash when ``decltype(__builtin_FUNCTION())`` is used as a template type argument. (#GH167433)
OpenACC Specific Changes
------------------------

View File

@ -2255,7 +2255,7 @@ SourceLocExpr::SourceLocExpr(const ASTContext &Ctx, SourceLocIdentKind Kind,
SourceLocExprBits.Kind = llvm::to_underlying(Kind);
// In dependent contexts, function names may change.
setDependence(MayBeDependent(Kind) && ParentContext->isDependentContext()
? ExprDependence::Value
? ExprDependence::ValueInstantiation
: ExprDependence::None);
}

View File

@ -39,3 +39,20 @@ void do_default_arg_test() {
}
} // namespace test_func
namespace test_decltype_template {
template <typename> void template_func() {}
// CHECK: define linkonce_odr {{(dso_local )?}}void @_ZN22test_decltype_template21use_decltype_templateIiEEvv(
// CHECK: call void @_ZN22test_decltype_template13template_funcIPKcEEvv()
template <typename> void use_decltype_template() {
template_func<decltype(__builtin_FUNCTION())>();
}
// CHECK: define linkonce_odr {{(dso_local )?}}void @_ZN22test_decltype_template13template_funcIPKcEEvv()
void do_decltype_template_test() {
use_decltype_template<int>();
}
} // namespace test_decltype_template