Bugzilla – Attachment 15 Details for
Bug 25
Segmentation fault on a simple template class; no segfault if substitute class by structure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug creation and email sending has been disabled, file new bugs at
gcc.gnu.org/bugzilla
the code that segfaults
bug.d (text/x-dsrc), 396 bytes, created by
Alexander Samoilov
on 2012-11-03 17:55:26 CET
(
hide
)
Description:
the code that segfaults
Filename:
MIME Type:
Creator:
Alexander Samoilov
Created:
2012-11-03 17:55:26 CET
Size:
396 bytes
patch
obsolete
> >/*struct*/ class bits(int MSB, int LSB) { > > enum { msb = MSB, lsb = LSB, span = MSB-LSB+1, } > > static const ulong mask = (1L << span) - 1; > > ulong slice(ulong val) const { return ((val >> lsb) & mask); } >} > >import std.stdio; >void main() { > > ulong a = 0xFEE0DDF00D; > bits!(28,12) slicer; > > auto sliced = slicer.slice(a); > writefln("slicer(28,12) : %X",slicer.slice(a)); >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 25
: 15