Hello.
The attached patch adds type source info to compound literals.
Cheers,
Enea.
CompoundLiteralExpr.patch (11.6 KB)
Hello.
The attached patch adds type source info to compound literals.
Cheers,
Enea.
CompoundLiteralExpr.patch (11.6 KB)
Looks good! Committed as r93752, with one tweak:
@@ -3849,15 +3849,17 @@
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCompoundLiteralExpr(CompoundLiteralExpr *E) {
- QualType T;
+ TypeSourceInfo *OldT;
+ TypeSourceInfo *NewT;
{
// FIXME: Source location isn't quite accurate.
SourceLocation FakeTypeLoc
= SemaRef.PP.getLocForEndOfToken(E->getLParenLoc());
TemporaryBase Rebase(*this, FakeTypeLoc, DeclarationName());
- T = getDerived().TransformType(E->getType());
- if (T.isNull())
+ OldT = E->getTypeSourceInfo();
+ NewT = getDerived().TransformType(OldT);
+ if (!NewT)
return SemaRef.ExprError();
}
This rebase is being done purely to give slightly better locations when rebuilding the type, so you can kill it since you're rebuilding an actual TypeSourceInfo.
John.