Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make bitfields part of D #16084

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions compiler/src/dmd/dsymbolsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -1494,14 +1494,6 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
if (dsym.errors)
return;

if (!(global.params.bitfields || sc.flags & SCOPE.Cfile))
{
version (IN_GCC)
.error(dsym.loc, "%s `%s` use `-fpreview=bitfields` for bitfield support", dsym.kind, dsym.toPrettyChars);
else
.error(dsym.loc, "%s `%s` use -preview=bitfields for bitfield support", dsym.kind, dsym.toPrettyChars);
}

if (!dsym.parent.isStructDeclaration() && !dsym.parent.isClassDeclaration())
{
.error(dsym.loc, "%s `%s` - bit-field must be member of struct, union, or class", dsym.kind, dsym.toPrettyChars);
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/compilable/dbitfield.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
*/

/***************************************************/
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/biterrors.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
* TEST_OUTPUT:
---
fail_compilation/biterrors.d(103): Error: initializer not allowed for bit-field declaration
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/biterrors2.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
* TEST_OUTPUT:
---
fail_compilation/biterrors2.d(100): Error: variable `biterrors2.a` - bit-field must be member of struct, union, or class
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/biterrors3.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
* TEST_OUTPUT:
---
fail_compilation/biterrors3.d(103): Error: storage class not allowed for bit-field declaration
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/biterrors4.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
* TEST_OUTPUT:
---
fail_compilation/biterrors4.d(109): Error: cannot take address of bit-field `a`
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/dbitfields.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
* TEST_OUTPUT:
---
fail_compilation/dbitfields.d(118): Error: reinterpretation through overlapped field `e` is not allowed in CTFE
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/test16188.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
* TEST_OUTPUT:
---
fail_compilation/test16188.d(101): Error: no property `name` for `Where()` of type `test16188.Where`
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/fail_compilation/test17284.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TEST_OUTPUT:
fail_compilation/test17284.d(17): Error: field `U.c` cannot access pointers in `@safe` code that overlap other fields
pure nothrow @safe void(U t)
---
REQUIRED_ARGS: -preview=bitfields

*/

// https://issues.dlang.org/show_bug.cgi?id=17284
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/bit.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
*/

struct T
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/dbitfields.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* REQUIRED_ARGS: -preview=bitfields
/*
*/

struct S
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/dbitfieldsdm.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* test bitfields for Digital Mars
* Note that this test is for win32 only
*
* REQUIRED_ARGS: -preview=bitfields
*
* DISABLED: win32mscoff win64 linux freebsd osx
* RUN_OUTPUT:
---
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/dbitfieldsms.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* test bitfields for Microsoft C
* REQUIRED_ARGS: -preview=bitfields
*
* DISABLED: win32 linux32 freebsd32 osx32 linux64 freebsd64 osx64
* RUN_OUTPUT:
---
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/dbitfieldsposix32.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* test bitfields
* REQUIRED_ARGS: -preview=bitfields
*
* DISABLED: win32 win64 linux64 freebsd64 osx64
* RUN_OUTPUT:
---
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/dbitfieldsposix64.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* test bitfields
* REQUIRED_ARGS: -preview=bitfields
*
* DISABLED: win32 win64 linux32 freebsd32 osx32
* RUN_OUTPUT:
---
Expand Down