Fix ICE with constexpr and friend functions

Authored by ogoffart on Feb 7 2016, 11:39 AM.



Fix a crash while parsing this code:

struct X  {
  friend constexpr int foo(X*) { return 12; }
  static constexpr int j = foo(static_cast<X*>(nullptr));

I also added a test for the static function case because i don't think this was tested before.

Diff Detail

ogoffart retitled this revision from to Fix ICE with constexpr and friend functions .Feb 7 2016, 11:39 AM
ogoffart updated this object.
ogoffart added reviewers: rsmith, cfe-commits.
ogoffart updated this revision to Diff 47146.Feb 7 2016, 11:58 AM

Optimized by avoiding repeated call to getBody

rsmith accepted this revision.Feb 11 2016, 5:27 PM

LGTM, thanks!

This revision is now accepted and ready to land.Feb 11 2016, 5:27 PM
This revision was automatically updated to reflect the committed changes.