This is an archive of the discontinued LLVM Phabricator instance.

[C++] Parse (sub) postfix expression after boolean literal
ClosedPublic

Authored by Rakete1111 on Sep 27 2017, 8:01 PM.

Details

Summary

Parses a postfix expression after a boolean literal:

auto x = true["Oh really?"]; // ok

This fixes PR34273.

Diff Detail

Event Timeline

Rakete1111 created this revision.Sep 27 2017, 8:01 PM
Rakete1111 edited the summary of this revision. (Show Details)
Rakete1111 edited the summary of this revision. (Show Details)Sep 27 2017, 8:05 PM
aaron.ballman added inline comments.
test/CXX/expr/expr.post/expr.sub/p1.cpp
3–6 ↗(On Diff #116917)

I think this test should be added to test/Parser/ instead of CXX; this does not really appertain to [expr.sub]p1, which is more about the semantics than the parsing.

4–5 ↗(On Diff #116917)

The "expected-no-diagnostics" comment should be right below the RUN line, and you only need it once.

  • Moved test to test/CXX/

Do I actually need to -verify the test if no diagnostics are expected?

Thanks @aaron.ballman

aaron.ballman edited edge metadata.Sep 28 2017, 1:59 PM
  • Moved test to test/CXX/

Do I actually need to -verify the test if no diagnostics are expected?

Thanks @aaron.ballman

Yes, you need to make sure that verify is on the RUN line. The existing test is broken like that (good catch). You should add -verify to the run line and // expected-no-diagnostics below it.

  • Fixed test case for bools

Ah got it! Thanks!!

aaron.ballman accepted this revision.Sep 28 2017, 2:20 PM

LGTM! Do you need me to commit on your behalf?

This revision is now accepted and ready to land.Sep 28 2017, 2:20 PM
aaron.ballman closed this revision.Sep 28 2017, 2:31 PM

Committed in r314463.

Btw, if you're not in the IRC channel (#llvm on OFTC), you should hang out in there to make sure no build bots break due to the commit.