public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
@ 2005-10-05 21:03 ` bkoz at gcc dot gnu dot org
  2005-10-05 21:06 ` bkoz at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-10-05 21:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from bkoz at gcc dot gnu dot org  2005-10-05 21:03 -------

Richard adding you.


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
  2005-10-05 21:03 ` [Bug c++/17743] dependent expressions in attributes bkoz at gcc dot gnu dot org
@ 2005-10-05 21:06 ` bkoz at gcc dot gnu dot org
  2005-10-05 21:16 ` rth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-10-05 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from bkoz at gcc dot gnu dot org  2005-10-05 21:06 -------
Richard adding you. Any thoughts? We've been blocked on this for quite some
time. There are a large number of issues that would be resolved or that we
could try to make progress on if there was forward movement on this.

-benjamin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
  2005-10-05 21:03 ` [Bug c++/17743] dependent expressions in attributes bkoz at gcc dot gnu dot org
  2005-10-05 21:06 ` bkoz at gcc dot gnu dot org
@ 2005-10-05 21:16 ` rth at gcc dot gnu dot org
  2005-10-05 22:34 ` mark at codesourcery dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-10-05 21:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from rth at gcc dot gnu dot org  2005-10-05 21:16 -------
I'm surprised this is considered tricky.  Seems to me you just stuff the 
attribute away in the parse tree somewhere and pretend we've just read it
in during template instantiation.  That's what we do with everything else
related to templates after all.

"A mere matter of programming", I'd think.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-10-05 21:16 ` rth at gcc dot gnu dot org
@ 2005-10-05 22:34 ` mark at codesourcery dot com
  2007-09-22 14:29 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: mark at codesourcery dot com @ 2005-10-05 22:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from mark at codesourcery dot com  2005-10-05 22:34 -------
Subject: Re:  dependent expressions in attributes

rth at gcc dot gnu dot org wrote:
> ------- Comment #23 from rth at gcc dot gnu dot org  2005-10-05 21:16 -------
> I'm surprised this is considered tricky.  Seems to me you just stuff the 
> attribute away in the parse tree somewhere and pretend we've just read it
> in during template instantiation.  That's what we do with everything else
> related to templates after all.
> 
> "A mere matter of programming", I'd think.

I agree.  There may be some attributes which need to be processed at
parse-time, before instantiation-time, but that's just more programming.
   I'd expect it to involve touching rather more code than one would
like, though...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2005-10-05 22:34 ` mark at codesourcery dot com
@ 2007-09-22 14:29 ` jason at gcc dot gnu dot org
  2007-09-22 14:30 ` jason at gcc dot gnu dot org
  2007-09-25 21:48 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-22 14:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from jason at gcc dot gnu dot org  2007-09-22 14:29 -------
Fixed for 4.3.0.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2007-09-22 14:29 ` jason at gcc dot gnu dot org
@ 2007-09-22 14:30 ` jason at gcc dot gnu dot org
  2007-09-25 21:48 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-22 14:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from jason at gcc dot gnu dot org  2007-09-22 14:30 -------
Change state.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
       [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2007-09-22 14:30 ` jason at gcc dot gnu dot org
@ 2007-09-25 21:48 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-09-25 21:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-10-27 17:19 ` bkoz at gcc dot gnu dot org
@ 2004-10-28  3:38 ` giovannibajo at libero dot it
  8 siblings, 0 replies; 16+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-28  3:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-28 03:38 -------
(In reply to comment #19)

> Jason, this is the bug I talked about briefly. Do you think
> the Redmond offsetof work is also applicable here?

Mind to share that?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-10-19  6:23 ` bkoz at redhat dot com
@ 2004-10-27 17:19 ` bkoz at gcc dot gnu dot org
  2004-10-28  3:38 ` giovannibajo at libero dot it
  8 siblings, 0 replies; 16+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-10-27 17:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-10-27 17:19 -------

Jason, this is the bug I talked about briefly. Do you think the Redmond offsetof
work is also applicable here?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-10-18 18:57 ` bkoz at gcc dot gnu dot org
@ 2004-10-19  6:23 ` bkoz at redhat dot com
  2004-10-27 17:19 ` bkoz at gcc dot gnu dot org
  2004-10-28  3:38 ` giovannibajo at libero dot it
  8 siblings, 0 replies; 16+ messages in thread
From: bkoz at redhat dot com @ 2004-10-19  6:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at redhat dot com  2004-10-19 06:23 -------
Subject: Re:  dependent expressions in attributes


>Yes, but how do you force the compiler to ensure that the alignment of char foo
>[] is sufficient to placement-allocate an object of type T into it?

...get __alignof__(T) working?

I don't see any other way, really. 

-benjamin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-10-18 16:38 ` giovannibajo at libero dot it
@ 2004-10-18 18:57 ` bkoz at gcc dot gnu dot org
  2004-10-19  6:23 ` bkoz at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-10-18 18:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-10-18 18:57 -------
Giovanni, this is applicable to TR1 via 

4.5.5 Other transformations [tr.meta.trans.other] template <std :: size_t Len ,
std :: size_t Align > struct aligned_storage { typedef unspecified type ; }; 1
type: an implementation defined POD type with size Len and alignment Align, and
suitable for use as uninitialized storage for any object of a type whose size is
Len and whose alignment is Align.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-10-18  5:23 ` bkoz at redhat dot com
@ 2004-10-18 16:38 ` giovannibajo at libero dot it
  2004-10-18 18:57 ` bkoz at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-18 16:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-18 16:38 -------
(In reply to comment #15)

> I guess I don't see why/how alignof should be different than sizeof
> here (which works):
>  template <class T>
>  struct A 
>  {
>    char foo[sizeof(T)];
>  };

Yes, but how do you force the compiler to ensure that the alignment of char foo
[] is sufficient to placement-allocate an object of type T into it?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-10-18  3:51 ` giovannibajo at libero dot it
@ 2004-10-18  5:23 ` bkoz at redhat dot com
  2004-10-18 16:38 ` giovannibajo at libero dot it
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: bkoz at redhat dot com @ 2004-10-18  5:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at redhat dot com  2004-10-18 05:23 -------
Subject: Re:  dependent expressions in attributes


>Is this a showstopper for tr1 work?
 
Not that I can see. From what I can tell, tr1::array is going to require
default-constructable types. 

I think the library hackers are interested in this kind of stuff for our
own selfish reasons.

I guess I don't see why/how alignof should be different than sizeof
here (which works):

 template <class T>
 struct A 
 {
   char foo[sizeof(T)];
 };

-benjamin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
  2004-10-17  4:48 ` [Bug c++/17743] dependent expressions in attributes giovannibajo at libero dot it
  2004-10-17  7:50 ` gdr at cs dot tamu dot edu
@ 2004-10-18  3:51 ` giovannibajo at libero dot it
  2004-10-18  5:23 ` bkoz at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-18  3:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-18 03:51 -------
Subject: Re:  dependent expressions in attributes

>> template <class T>
>> struct A {
>>     char foo __attribute__((aligned(__alignof__(T))));
>> };
> 
> I do care.

Is this a showstopper for tr1 work?

Giovanni Bajo




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
  2004-10-17  4:48 ` [Bug c++/17743] dependent expressions in attributes giovannibajo at libero dot it
@ 2004-10-17  7:50 ` gdr at cs dot tamu dot edu
  2004-10-18  3:51 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-17  7:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at cs dot tamu dot edu  2004-10-17 07:50 -------
Subject: Re:  dependent expressions in attributes

On Sat, 17 Oct 2004, giovannibajo at libero dot it wrote:

| OK, I fixed part of this for 4.0. The missing part is when the expression in
| attributes is dependent, like:
|
| template <class T>
| struct A {
|     char foo __attribute__((aligned(__alignof__(T))));
| };
|
| This is non-trivial to fix. Benjamin, if you want you can keep this bugreport
| open to track this. I do not plan to be able to fix this in the 4.0 timeframe,
| so I have unassigned the bug (I will attempt something though). If somebody
| more expert than me wants to help the v3 guys, feel free.
|
| Otherwise, if you do not care about this, just close this bug.

I do care.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/17743] dependent expressions in attributes
  2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
@ 2004-10-17  4:48 ` giovannibajo at libero dot it
  2004-10-17  7:50 ` gdr at cs dot tamu dot edu
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-17  4:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-17 04:47 -------
OK, I fixed part of this for 4.0. The missing part is when the expression in 
attributes is dependent, like:

template <class T>
struct A {
    char foo __attribute__((aligned(__alignof__(T))));
};

This is non-trivial to fix. Benjamin, if you want you can keep this bugreport 
open to track this. I do not plan to be able to fix this in the 4.0 timeframe, 
so I have unassigned the bug (I will attempt something though). If somebody 
more expert than me wants to help the v3 guys, feel free.

Otherwise, if you do not care about this, just close this bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|giovannibajo at libero dot  |unassigned at gcc dot gnu
                   |it                          |dot org
             Status|ASSIGNED                    |NEW
            Summary|__alignof__ vs. typedefs    |dependent expressions in
                   |                            |attributes


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17743


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-09-25 21:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-17743-365@http.gcc.gnu.org/bugzilla/>
2005-10-05 21:03 ` [Bug c++/17743] dependent expressions in attributes bkoz at gcc dot gnu dot org
2005-10-05 21:06 ` bkoz at gcc dot gnu dot org
2005-10-05 21:16 ` rth at gcc dot gnu dot org
2005-10-05 22:34 ` mark at codesourcery dot com
2007-09-22 14:29 ` jason at gcc dot gnu dot org
2007-09-22 14:30 ` jason at gcc dot gnu dot org
2007-09-25 21:48 ` pinskia at gcc dot gnu dot org
2004-09-30  4:26 [Bug c++/17743] New: __alignof__ vs. typedefs bkoz at gcc dot gnu dot org
2004-10-17  4:48 ` [Bug c++/17743] dependent expressions in attributes giovannibajo at libero dot it
2004-10-17  7:50 ` gdr at cs dot tamu dot edu
2004-10-18  3:51 ` giovannibajo at libero dot it
2004-10-18  5:23 ` bkoz at redhat dot com
2004-10-18 16:38 ` giovannibajo at libero dot it
2004-10-18 18:57 ` bkoz at gcc dot gnu dot org
2004-10-19  6:23 ` bkoz at redhat dot com
2004-10-27 17:19 ` bkoz at gcc dot gnu dot org
2004-10-28  3:38 ` giovannibajo at libero dot it

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).