From bf72f7d1097da908a3e96736e90466fb77a11670 Mon Sep 17 00:00:00 2001 From: Dennis Korpel Date: Thu, 13 Oct 2022 22:12:52 +0200 Subject: [PATCH] Fix 23410 - ImportC: binary constants not allowed --- compiler/src/dmd/lexer.d | 2 -- compiler/test/fail_compilation/numliteral.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/src/dmd/lexer.d b/compiler/src/dmd/lexer.d index 45a7de4880..451e227e98 100644 --- a/compiler/src/dmd/lexer.d +++ b/compiler/src/dmd/lexer.d @@ -1992,8 +1992,6 @@ class Lexer break; case 'b': case 'B': - if (Ccompile) - error("binary constants not allowed"); ++p; base = 2; break; diff --git a/compiler/test/fail_compilation/numliteral.c b/compiler/test/fail_compilation/numliteral.c index c3dd4c80eb..d7ad00bfb4 100644 --- a/compiler/test/fail_compilation/numliteral.c +++ b/compiler/test/fail_compilation/numliteral.c @@ -1,13 +1,13 @@ /* TEST_OUTPUT: --- -fail_compilation/numliteral.c(10): Error: binary constants not allowed fail_compilation/numliteral.c(11): Error: embedded `_` not allowed --- */ +int x = 0b00; // https://issues.dlang.org/show_bug.cgi?id=23410 + // Test C-specific errors -int x = 0b00; int y = 0_1; // https://issues.dlang.org/show_bug.cgi?id=22549