This is an archive of the discontinued LLVM Phabricator instance.

[C++17] Disallow lambdas in template parameters (PR33696).
ClosedPublic

Authored by Rakete1111 on Sep 4 2017, 9:03 AM.

Diff Detail

Event Timeline

Rakete1111 created this revision.Sep 4 2017, 9:03 AM
rsmith added inline comments.Sep 5 2017, 1:26 PM
include/clang/Sema/Sema.h
979–980

Instead of a sequence of bools, can you add an enum for decltype / template argument / other?

Good idea! Updated diff :)

  • rebased

Does anyone have a better name than ExpressionType? I don't really like it.

Rakete1111 updated this revision to Diff 128667.Jan 4 2018, 3:56 PM

Rebased + friendly 2018 ping

rsmith accepted this revision.Jan 4 2018, 4:14 PM

Thanks, looks good other than ExpressionType. This is fine to commit with either of the names I suggested; let me know if you have a better alternative :)

include/clang/Sema/Sema.h
935–939

This name is too vague as a member of Sema, but would be OK as a member of ExpressionEvaluationContextRecord, or if renamed to something like ExpressionEvaluationContextExprKind. (Also, we generally use Kind rather than Type for situations like this.)

This revision is now accepted and ready to land.Jan 4 2018, 4:14 PM

I put the enum in ExpressionEvaluationContextRecord now, and fixed the Type -> Kind issue.

If it's still ok, could you please commit it @rsmith? Thanks :)

Rebase and ping :)

Rebase and friendly ping :)

Rebased + friendly ping :)

rsmith accepted this revision.Jun 21 2018, 2:22 PM

Please also change the EnterExpressionEvaluationContext in TreeTransform::TransformTemplateArgument to specify EK_TemplateArgument (though that doesn't actually matter for the lambda diagnostics because we'll find all the problems in the template definition context). Then this LGTM. Thanks!

include/clang/Sema/Sema.h
984

Should EK_TemplateParameter be EK_TemplateArgument?

Added expression evaluation context to TreeTransform :)

Rakete1111 marked 3 inline comments as done.Jun 27 2018, 2:04 PM

Rebased + friendly ping

rsmith accepted this revision.Jul 10 2018, 2:53 PM
rsmith added inline comments.
include/clang/Sema/Sema.h
3980–3984

Please check this fits into 80 columns and wrap the line if not.

Format lines longer than 80 characters correctly.

Rakete1111 marked an inline comment as done.Jul 12 2018, 11:41 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.