diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 01:59:51 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 01:59:51 +0000 |
commit | 9e738cc9d4b4655c44dadeb22f3a314daf43b995 (patch) | |
tree | 0bf50b2a66275da24dd3406e62b032e5a9ea815f /lib/Parse/Parser.cpp | |
parent | 5e5440ba9c135f523f72e7e7c5da59d390d697c5 (diff) |
Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.
Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 2d8d5b1322..d9772755bd 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -1878,7 +1878,9 @@ Parser::DeclGroupPtrTy Parser::ParseModuleImport(SourceLocation AtLoc) { } bool BalancedDelimiterTracker::diagnoseOverflow() { - P.Diag(P.Tok, diag::err_parser_impl_limit_overflow); + P.Diag(P.Tok, diag::err_bracket_depth_exceeded) + << P.getLangOpts().BracketDepth; + P.Diag(P.Tok, diag::note_bracket_depth); P.SkipUntil(tok::eof); return true; } |