Skip to content

Commit 1a73ca6

Browse files
committed
Reapply "[Clang][Sema] placement new initializes typedef array with correct size
fixing the regression test failure
1 parent c64cd9d commit 1a73ca6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ Improvements to Clang's diagnostics
364364
- Clang now uses the correct type-parameter-key (``class`` or ``typename``) when printing
365365
template template parameter declarations.
366366

367+
- Clang now diagnoses requires expressions with explicit object parameters.
368+
367369
Improvements to Clang's time-trace
368370
----------------------------------
369371

@@ -534,6 +536,8 @@ Bug Fixes to C++ Support
534536
Fixes (#GH70604), (#GH79754), (#GH84163), (#GH84425), (#GH86054), (#GH86398), and (#GH86399).
535537
- Fix a crash when deducing ``auto`` from an invalid dereference (#GH88329).
536538
- Fix a crash in requires expression with templated base class member function. Fixes (#GH84020).
539+
- Fix a crash caused by defined struct in a type alias template when the structure
540+
has fields with dependent type. Fixes (#GH75221).
537541
- Fix placement new initializes typedef array with correct size. Fixes (#GH41441).
538542

539543
Bug Fixes to AST Handling

clang/lib/Sema/TreeTransform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12867,7 +12867,7 @@ TreeTransform<Derived>::TransformCXXNewExpr(CXXNewExpr *E) {
1286712867
// Per C++0x [expr.new]p5, the type being constructed may be a
1286812868
// typedef of an array type.
1286912869
QualType AllocType = AllocTypeInfo->getType();
12870-
if (ArraySize) {
12870+
if (ArraySize && E->isTypeDependent()) {
1287112871
if (const ConstantArrayType *Array =
1287212872
SemaRef.Context.getAsConstantArrayType(AllocType)) {
1287312873
ArraySize = IntegerLiteral::Create(SemaRef.Context, Array->getSize(),

0 commit comments

Comments
 (0)