Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ Bug Fixes to C++ Support
out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218)
- Fixed a pack expansion issue in checking unexpanded parameter sizes. (#GH17042)
- Fixed a bug where captured structured bindings were modifiable inside non-mutable lambda (#GH95081)
- Fixed an issue while resolving type of expression indexing into a pack of values of non-dependent type (#GH121242)

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/ExprCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@ PackIndexingExpr *PackIndexingExpr::Create(
if (Index && FullySubstituted && !SubstitutedExprs.empty())
Type = SubstitutedExprs[*Index]->getType();
else
Type = Context.DependentTy;
Type = PackIdExpr->getType();

void *Storage =
Context.Allocate(totalSizeToAlloc<Expr *>(SubstitutedExprs.size()));
Expand Down
16 changes: 16 additions & 0 deletions clang/test/SemaCXX/cxx2c-pack-indexing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,19 @@ template <class... Args> struct mdispatch_ {
mdispatch_<int, int> d;

} // namespace GH116105

namespace GH121242 {
// Non-dependent type pack access
template <int...x>
int y = x...[0];

struct X {};

template <X...x>
X z = x...[0];

void foo() {
(void)y<0>;
(void)z<X{}>;
}
} // namespace GH121242
Loading