Skip to content

Commit dca96b7

Browse files
committed
make bitfields part of D
1 parent caf0e12 commit dca96b7

File tree

17 files changed

+208
-23
lines changed

17 files changed

+208
-23
lines changed

compiler/src/dmd/dsymbolsem.d

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,14 +1577,6 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
15771577
if (dsym.errors)
15781578
return;
15791579

1580-
if (!(sc.previews.bitfields || sc.inCfile))
1581-
{
1582-
version (IN_GCC)
1583-
.error(dsym.loc, "%s `%s` use `-fpreview=bitfields` for bitfield support", dsym.kind, dsym.toPrettyChars);
1584-
else
1585-
.error(dsym.loc, "%s `%s` use -preview=bitfields for bitfield support", dsym.kind, dsym.toPrettyChars);
1586-
}
1587-
15881580
if (!dsym.parent.isStructDeclaration() && !dsym.parent.isClassDeclaration())
15891581
{
15901582
.error(dsym.loc, "%s `%s` - bit-field must be member of struct, union, or class", dsym.kind, dsym.toPrettyChars);

compiler/test/compilable/dbitfield.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
*/
33

44
/***************************************************/

compiler/test/fail_compilation/biterrors.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/biterrors.d(103): Error: initializer not allowed for bit-field declaration

compiler/test/fail_compilation/biterrors2.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/biterrors2.d(100): Error: variable `biterrors2.a` - bit-field must be member of struct, union, or class

compiler/test/fail_compilation/biterrors3.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/biterrors3.d(103): Error: storage class not allowed for bit-field declaration

compiler/test/fail_compilation/biterrors4.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/biterrors4.d(109): Error: cannot take address of bit-field `a`

compiler/test/fail_compilation/biterrors5.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/biterrors5.d(23): Error: bitfield symbol expected not struct `biterrors5.S`

compiler/test/fail_compilation/bitintro.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
*/
33

44
struct S

compiler/test/fail_compilation/dbitfields.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/dbitfields.d(118): Error: reinterpretation through overlapped field `e` is not allowed in CTFE

compiler/test/fail_compilation/test16188.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* REQUIRED_ARGS: -preview=bitfields
1+
/*
22
* TEST_OUTPUT:
33
---
44
fail_compilation/test16188.d(101): Error: no property `name` for `Where()` of type `test16188.Where`

0 commit comments

Comments
 (0)