Skip to content

Commit 881edfe

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:305fbc1b3203 into amd-gfx:2c6385754d0b
Local branch amd-gfx 2c63857 Merged main:78c49743c7fb into amd-gfx:9e2030a02320 Remote branch main 305fbc1 Revert "[GlobalISel] LegalizationArtifactCombiner: Elide redundant G_AND"
2 parents 2c63857 + 305fbc1 commit 881edfe

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ Bug Fixes in This Version
266266
(`#64836 <https://github.com/llvm/llvm-project/issues/64836>`_)
267267
- Clang now allows an ``_Atomic`` qualified integer in a switch statement. Fixes
268268
(`#65557 <https://github.com/llvm/llvm-project/issues/65557>`_)
269+
- Fixes crash when trying to obtain the common sugared type of
270+
`decltype(instantiation-dependent-expr)`.
271+
Fixes (`#67603 <https://github.com/llvm/llvm-project/issues/67603>`_)
269272

270273
Bug Fixes to Compiler Builtins
271274
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/AST/ASTContext.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12705,7 +12705,6 @@ static QualType getCommonNonSugarTypeNode(ASTContext &Ctx, const Type *X,
1270512705

1270612706
#define SUGAR_FREE_TYPE(Class) UNEXPECTED_TYPE(Class, "sugar-free")
1270712707
SUGAR_FREE_TYPE(Builtin)
12708-
SUGAR_FREE_TYPE(Decltype)
1270912708
SUGAR_FREE_TYPE(DeducedTemplateSpecialization)
1271012709
SUGAR_FREE_TYPE(DependentBitInt)
1271112710
SUGAR_FREE_TYPE(Enum)
@@ -12935,6 +12934,15 @@ static QualType getCommonNonSugarTypeNode(ASTContext &Ctx, const Type *X,
1293512934
TY->getTemplateName()),
1293612935
As, X->getCanonicalTypeInternal());
1293712936
}
12937+
case Type::Decltype: {
12938+
const auto *DX = cast<DecltypeType>(X);
12939+
[[maybe_unused]] const auto *DY = cast<DecltypeType>(Y);
12940+
assert(DX->isDependentType());
12941+
assert(DY->isDependentType());
12942+
assert(Ctx.hasSameExpr(DX->getUnderlyingExpr(), DY->getUnderlyingExpr()));
12943+
// As Decltype is not uniqued, building a common type would be wasteful.
12944+
return QualType(DX, 0);
12945+
}
1293812946
case Type::DependentName: {
1293912947
const auto *NX = cast<DependentNameType>(X),
1294012948
*NY = cast<DependentNameType>(Y);

clang/test/SemaCXX/sugar-common-types.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,14 @@ namespace PR61419 {
142142
extern const pair<id, id> p;
143143
id t = false ? p.first : p.second;
144144
} // namespace PR61419
145+
146+
namespace GH67603 {
147+
template <class> using A = long;
148+
template <class B> void h() {
149+
using C = B;
150+
using D = B;
151+
N t = 0 ? A<decltype(C())>() : A<decltype(D())>();
152+
// expected-error@-1 {{rvalue of type 'A<decltype(C())>' (aka 'long')}}
153+
}
154+
template void h<int>();
155+
} // namespace GH67603

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 476304
19+
#define LLVM_MAIN_REVISION 476308
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

0 commit comments

Comments
 (0)