Skip to content

Commit 6635b51

Browse files
committed
[clang] Increase the default expression nesting limit
Increase the default expression nesting limit from 256 to 1024
1 parent bcbe9d6 commit 6635b51

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7959,7 +7959,7 @@ def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-
79597959
MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
79607960
def fbracket_depth : Separate<["-"], "fbracket-depth">,
79617961
HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
7962-
MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
7962+
MarshallingInfoInt<LangOpts<"BracketDepth">, "1024">;
79637963
defm const_strings : BoolOption<"f", "const-strings",
79647964
LangOpts<"ConstStrings">, DefaultFalse,
79657965
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,

clang/test/Parser/parser_overflow.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: not %clang_cc1 %s -fsyntax-only -DHUGE 2>&1 | FileCheck %s
2-
// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
2+
// RUN: %clang_cc1 %s -fsyntax-only
33
// RUN: not %clang_cc1 %s -fsyntax-only -fbracket-depth 299 2>&1 | FileCheck %s
44
// RUN: %clang_cc1 %s -fsyntax-only -fbracket-depth 300
55
// RUN: not %clang %s -fsyntax-only -fbracket-depth=299 2>&1 | FileCheck %s
@@ -15,5 +15,5 @@ void foo(void) {
1515
#endif
1616
}
1717

18-
// CHECK: fatal error: bracket nesting level exceeded maximum of {{256|299}}
18+
// CHECK: fatal error: bracket nesting level exceeded maximum of {{1024|299}}
1919
// CHECK: note: use -fbracket-depth=N to increase maximum nesting level

0 commit comments

Comments
 (0)