This is an archive of the discontinued LLVM Phabricator instance.

Remove Expr sugar decorating the CXXUuidofExpr node.
ClosedPublic

Authored by void on Jan 23 2019, 12:13 PM.

Diff Detail

Repository
rC Clang

Event Timeline

void created this revision.Jan 23 2019, 12:13 PM
aaron.ballman added inline comments.
lib/Sema/SemaTemplate.cpp
6311

IgnoreParenImpCasts() or are the paren expressions of value?

test/CodeGenCXX/pr40395.cpp
1 ↗(On Diff #183149)

Why is this test in CodeGenCXX instead of SemaCXX?

The RUN line doesn't seem to be testing anything? Should there be a -verify and // expected-no-diagnostics involved?

It might also be a good idea to add some comments that explain the test case.

void marked 2 inline comments as done.Jan 23 2019, 2:32 PM
void added inline comments.
lib/Sema/SemaTemplate.cpp
6311

I want to make this a minimal change. Richard was okay with just the implicit casts. I'm not relaly qualified in this part of the code to say that we should also include parentheses in this. I'll leave that up to you and Richard.

https://bugs.llvm.org/show_bug.cgi?id=40395
void updated this revision to Diff 183180.Jan 23 2019, 2:33 PM

Move test to proper place and add "-verify" flag.

riccibruno added inline comments.
lib/Sema/SemaTemplate.cpp
6311

A remark which I hope is relevant. Please ignore it if I am off the mark, or if it is obvious.

I was looking at which of the Expr::Ignore* function to use for something else and it seems that IgnoreParenImpCasts() is *not* equivalent to doing IgnoreParens() + IgnoreImpCasts() until reaching a fixed point.

This is very surprising given the name, and given that IgnoreParenCasts() *is* equivalent to doing IgnoreParens() + IgnoreCasts() until reaching a fixed point.

From my notes:

  • Expr *IgnoreParenImpCasts() LLVM_READONLY Ought to be IgnoreParens() + IgnoreImpCasts() until fixed point. But actually only IgnoreParens + skip:
    • ImplicitCastExpr
    • MaterializeTemporaryExpr
    • SubstNonTypeTemplateParmExpr
aaron.ballman accepted this revision.Jan 24 2019, 12:53 PM

LGTM!

lib/Sema/SemaTemplate.cpp
6311

I want to make this a minimal change. Richard was okay with just the implicit casts. I'm not relaly qualified in this part of the code to say that we should also include parentheses in this. I'll leave that up to you and Richard.

Ah, thank you for the link, that helps!

I was looking at which of the Expr::Ignore* function to use for something else and it seems that IgnoreParenImpCasts() is *not* equivalent to doing IgnoreParens() + IgnoreImpCasts() until reaching a fixed point.

That is surprising, and good to know!

This revision is now accepted and ready to land.Jan 24 2019, 12:53 PM
This revision was automatically updated to reflect the committed changes.
rnk added a comment.Jan 28 2019, 1:11 PM

Thanks for following up!