Skip to content

Commit e3ce979

Browse files
committed
Revert "[clang] Increase the default expression nesting limit (#104717)"
This reverts commit 7597e09. It caused several buildbot failures due to stack overflows with the parser test.
1 parent 002ba17 commit e3ce979

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ Deprecated Compiler Flags
174174
Modified Compiler Flags
175175
-----------------------
176176

177-
- The compiler flag `-fbracket-depth` default value is increased from 256 to 2048.
178-
179177
- The ``-ffp-model`` option has been updated to enable a more limited set of
180178
optimizations when the ``fast`` argument is used and to accept a new argument,
181179
``aggressive``. The behavior of ``-ffp-model=aggressive`` is equivalent

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7976,7 +7976,7 @@ def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-
79767976
MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
79777977
def fbracket_depth : Separate<["-"], "fbracket-depth">,
79787978
HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
7979-
MarshallingInfoInt<LangOpts<"BracketDepth">, "2048">;
7979+
MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
79807980
defm const_strings : BoolOption<"f", "const-strings",
79817981
LangOpts<"ConstStrings">, DefaultFalse,
79827982
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: %clang_cc1 %s -fsyntax-only
2+
// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
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 {{2048|299}}
18+
// CHECK: fatal error: bracket nesting level exceeded maximum of {{256|299}}
1919
// CHECK: note: use -fbracket-depth=N to increase maximum nesting level

0 commit comments

Comments
 (0)