[Parser] Warn when ScopeDepthOrObjCQuals overflows
authorMark de Wever <koraq@xs4all.nl>
Sat, 9 Nov 2019 14:32:35 +0000 (15:32 +0100)
committerMark de Wever <koraq@xs4all.nl>
Sat, 9 Nov 2019 14:33:01 +0000 (15:33 +0100)
commitb9be5ce8f3e0e697a61ad16e2c669de6ea8f8739
tree76ba44970aae6ffa41eeb9213aab819d7e96d3aa
parent56b5eab12970e540c629e9b9a8a95256c116a547
[Parser] Warn when ScopeDepthOrObjCQuals overflows

Before when the overflow occured an assertion was triggered. Now check
whether the maximum has been reached and warn properly.

This patch fixes the original submission of PR19607.

Differential Revision: https://reviews.llvm.org/D63975
clang/include/clang/AST/Decl.h
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/lib/Parse/ParseDecl.cpp
clang/test/Parser/nested_blocks_overflow.cpp [new file with mode: 0644]
clang/test/Parser/nested_function_prototype_overflow.cpp [new file with mode: 0644]
clang/test/Parser/nested_lambda_overflow.cpp [new file with mode: 0644]