Skip to content

Commit 73716bf

Browse files
committed
Evaluate static assertions when the CLI is invoked with -fcheck
Signed-off-by: Roberto Raggi <[email protected]>
1 parent 1def108 commit 73716bf

File tree

7 files changed

+1
-9
lines changed

7 files changed

+1
-9
lines changed

src/frontend/cxx/frontend.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ auto runOnFile(const CLI& cli, const std::string& fileName) -> bool {
314314
unit.parse(ParserConfiguration{
315315
.checkTypes = cli.opt_fcheck,
316316
.fuzzyTemplateResolution = true,
317-
.staticAssert = cli.opt_fstatic_assert || cli.opt_fcheck,
318317
.reflect = !cli.opt_fno_reflect,
319318
});
320319

src/lsp/cxx/lsp/cxx_document.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ void CxxDocument::parse(std::string source) {
271271
unit.parse(ParserConfiguration{
272272
.checkTypes = cli.opt_fcheck,
273273
.fuzzyTemplateResolution = true,
274-
.staticAssert = cli.opt_fstatic_assert || cli.opt_fcheck,
275274
.reflect = !cli.opt_fno_reflect,
276275
.stopParsingPredicate = stopParsingPredicate,
277276
.complete = complete,

src/parser/cxx/cli.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ std::vector<CLIOptionDescr> options{
146146

147147
{"-fsyntax-only", "Check only the syntax", &CLI::opt_fsyntax_only},
148148

149-
{"-fstatic-assert", "Enable static asserts", &CLI::opt_fstatic_assert,
150-
CLIOptionVisibility::kExperimental},
151-
152149
{"-freport-missing-types", "Report missing types",
153150
&CLI::opt_freport_missing_types},
154151

src/parser/cxx/cli.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ class CLI {
6666
bool opt_S = false;
6767
bool opt_c = false;
6868
bool opt_fsyntax_only = false;
69-
bool opt_fstatic_assert = false;
7069
bool opt_fcheck = false;
7170
bool opt_freport_missing_types = false;
7271
bool opt_fno_reflect = false;

src/parser/cxx/parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5281,7 +5281,7 @@ auto Parser::parse_static_assert_declaration(DeclarationAST*& yyast) -> bool {
52815281
value = visit(to_bool, *constValue);
52825282
}
52835283

5284-
if (!value && config_.staticAssert) {
5284+
if (!value && config_.checkTypes) {
52855285
SourceLocation loc = ast->firstSourceLocation();
52865286

52875287
if (!ast->expression || !constValue.has_value()) {

src/parser/cxx/parser_fwd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ using CodeCompletionContext =
4747
struct ParserConfiguration {
4848
bool checkTypes = false;
4949
bool fuzzyTemplateResolution = false;
50-
bool staticAssert = false;
5150
bool reflect = true;
5251
std::function<bool()> stopParsingPredicate;
5352
std::function<void(const CodeCompletionContext&)> complete;

tests/api_tests/test_substitution.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ struct Source {
5252
unit.parse({
5353
.checkTypes = true,
5454
.fuzzyTemplateResolution = false,
55-
.staticAssert = true,
5655
.reflect = true,
5756
});
5857
}

0 commit comments

Comments
 (0)