This is an archive of the discontinued LLVM Phabricator instance.

Detect recursive default argument definition
ClosedPublic

Authored by sepavloff on Jun 13 2016, 11:06 AM.

Details

Summary

If definition of default function argument uses itself, clang crashed,
because corresponding function parameter is not associated with the default
argument yet. With this fix clang emits appropriate error message.

This change fixes PR28105.

Diff Detail

Repository
rL LLVM

Event Timeline

sepavloff updated this revision to Diff 60564.Jun 13 2016, 11:06 AM
sepavloff retitled this revision from to Detect recursive default argument definition.
sepavloff updated this object.
sepavloff added a subscriber: cfe-commits.
majnemer accepted this revision.Jun 13 2016, 11:13 AM
majnemer added a reviewer: majnemer.
majnemer added a subscriber: majnemer.

LGTM

lib/Sema/SemaExpr.cpp
4570 ↗(On Diff #60564)

I'd make this !Param->hasInit().

This revision is now accepted and ready to land.Jun 13 2016, 11:13 AM
This revision was automatically updated to reflect the committed changes.