Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constexpr recurse #50

Open
wants to merge 1 commit into
base: bsl-tidy
Choose a base branch
from
Open

Conversation

ytuo
Copy link

@ytuo ytuo commented Aug 18, 2020

A7-5-2
Functions shall not call themselves from a constexpr (which is allowed).

Modeled off of misc-no-recursion. Made comments of my edits

FunctionDecl *CycleEntryFn = CyclicCallStack.front().Callee->getDefinition();
// And now, for ease of understanding, let's print the call sequence that
// forms the cycle in question.
if (!CycleEntryFn->isConstexprSpecified()) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code I added

A7-5-2
Finds strongly connected functions (by analyzing call graph for SCC's that are loops), diagnoses each function in the cycle, and displays one example of possible call graph loop (recursion).
Makes exception for constexpr functions, including lambdas implicitly marked constexpr in C++17 or later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant