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.
Paths
| Differential D16973
Fix ICE with constexpr and friend functions
ClosedPublic Authored by ogoffart on Feb 7 2016, 11:39 AM.
Details Summary 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 Event Timelineogoffart updated this object. This revision is now accepted and ready to land.Feb 11 2016, 5:27 PM Closed by commit rL260675: Fix ICE with constexpr and friend functions (authored by ogoffart). · Explain WhyFeb 12 2016, 4:39 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 47146 lib/AST/ExprConstant.cpp
test/SemaCXX/constant-expression-cxx11.cpp
|