Skip to content

Commit 504c05c

Browse files
committed
[Clang] Back out the source location workaround for CXXConstructExpr
This removes the workaround introduced in 3e1a9cf and 1ba7dc3. The issues should have been already resolved elsewhere, at least removing these lines doesn't break any existing tests. The workaround overwrote the right parenthesis location of the sub expression, which could be wrong when a CXXTemporaryObjectExpr occurs within a nested expression, e.g. `A(A(1, 2))`.
1 parent 613c38a commit 504c05c

File tree

4 files changed

+124
-86
lines changed

4 files changed

+124
-86
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ Bug Fixes to AST Handling
877877
- Fixed a malformed printout of ``CXXParenListInitExpr`` in certain contexts.
878878
- Fixed a malformed printout of certain calling convention function attributes. (#GH143160)
879879
- Fixed dependency calculation for TypedefTypes (#GH89774)
880+
- Fixed the right parenthesis source location of ``CXXTemporaryObjectExpr``. (#GH143711)
880881

881882
Miscellaneous Bug Fixes
882883
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Sema/Initialization.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,12 @@ class InitializationKind {
676676
}
677677

678678
/// Create a direct initialization for a functional cast.
679-
static InitializationKind CreateFunctionalCast(SourceRange TypeRange,
679+
static InitializationKind CreateFunctionalCast(SourceLocation StartLoc,
680+
SourceRange ParenRange,
680681
bool InitList) {
681682
return InitializationKind(InitList ? IK_DirectList : IK_Direct,
682-
IC_FunctionalCast, TypeRange.getBegin(),
683-
TypeRange.getBegin(), TypeRange.getEnd());
683+
IC_FunctionalCast, StartLoc,
684+
ParenRange.getBegin(), ParenRange.getEnd());
684685
}
685686

686687
/// Create a copy initialization.

0 commit comments

Comments
 (0)