[PATCH] D63975: Warn when ScopeDepthOrObjCQuals overflows

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 10:24:09 PDT 2019


rjmccall added a comment.

Thanks.

It's good to have a lambda test, but that one isn't actually testing the lambda path — the place the diagnostic will trigger is just the normal function-prototype path, just originally within a lambda.  You can do something like this:

  template <class T> int foo(T &&t);
  void bar(int x = foo(
      [](int x = foo(
      [](int x = foo(
      [](int x = foo(
      ...

It looks like you'll have to bump `-fbracket-level` to get a crash, but since that's configurable and this limit isn't, we should still be testing that.

Also I think the same problem can happen with the "blocks" extension — could you test that, too?  That would be something like (with `-fblocks`):

  void bar(int x = foo(
      ^(int x = foo(
      ^(int x = foo(
      ^(int x = foo(
      ...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63975/new/

https://reviews.llvm.org/D63975





More information about the cfe-commits mailing list