public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21560] New: #pragma(1) doesn't work on the inner classes inside the temlated class
@ 2005-05-13 22:51 yuri at tsoft dot com
2005-05-13 23:01 ` [Bug c++/21560] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 4+ messages in thread
From: yuri at tsoft dot com @ 2005-05-13 22:51 UTC (permalink / raw)
To: gcc-bugs
Example below prints 4, should be 1.
If #pragma pack() is removed it prints 1, also it prints 1 if the printing line
is also wrapped in pragmas.
If instead template stuff is removed at all it prints 1 correctly.
--example--
#include <iostream>
using namespace std;
template<typename C> struct Z {
#pragma pack(1)
union Packed {
struct {
int dx:2;
int dy:2;
};
unsigned char byte;
};
#pragma pack()
};
main() {
Z<int>::Packed x;
cout << sizeof(x) << endl;
}
--
Summary: #pragma(1) doesn't work on the inner classes inside the
temlated class
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: yuri at tsoft dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21560
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/21560] #pragma(1) doesn't work on the inner classes inside the temlated class
2005-05-13 22:51 [Bug c++/21560] New: #pragma(1) " yuri at tsoft dot com
@ 2005-05-13 23:01 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-13 23:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-13 23:01 -------
Confirmed, here is a compile time testcase instead of a runtime:
template<typename C> struct Z {
#pragma pack(1)
union Packed {
struct {
int dx:2;
int dy:2;
};
unsigned char byte;
};
#pragma pack()
};
int f[sizeof(Z<int>::Packed)==1?1:-1];
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Known to fail| |2.95.3 3.3.3 3.4.3 4.0.0
| |4.1.0
Last reconfirmed|0000-00-00 00:00:00 |2005-05-13 23:01:39
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21560
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-04 1:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-21560-6649@http.gcc.gnu.org/bugzilla/>
2007-06-11 18:11 ` [Bug c++/21560] #pragma(1) doesn't work on the inner classes inside the temlated class richard-gccbugzilla at metafoo dot co dot uk
2007-10-04 1:37 ` [Bug c++/21560] #pragma pack(1) " jason at gcc dot gnu dot org
2007-10-04 1:50 ` jason at gcc dot gnu dot org
2005-05-13 22:51 [Bug c++/21560] New: #pragma(1) " yuri at tsoft dot com
2005-05-13 23:01 ` [Bug c++/21560] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).