public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19407] New: vector keyword in typedef inside struct ignored
@ 2005-01-12 21:26 leblanc at skycomputers dot com
  2005-01-12 21:29 ` [Bug c++/19407] vector keyword in typedef inside template " leblanc at skycomputers dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: leblanc at skycomputers dot com @ 2005-01-12 21:26 UTC (permalink / raw)
  To: gcc-bugs

 

-- 
           Summary: vector keyword in typedef inside struct ignored
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: leblanc at skycomputers dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ppc-*-linux
  GCC host triplet: ppc-*-linux
GCC target triplet: ppc-*-linux


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
  2005-01-12 21:26 [Bug c++/19407] New: vector keyword in typedef inside struct ignored leblanc at skycomputers dot com
@ 2005-01-12 21:29 ` leblanc at skycomputers dot com
  2005-01-12 21:31 ` pinskia at gcc dot gnu dot org
  2005-05-01  2:53 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: leblanc at skycomputers dot com @ 2005-01-12 21:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From leblanc at skycomputers dot com  2005-01-12 21:29 -------
The program below prints 4-s instead of 16-s.

     1  #include <stdio.h>
     2  #include <altivec.h>
     3
     4  template < typename Val > struct S {
     5      typedef vector Val vector_type;
     6      void pr_size() { printf ("size = %d\n", sizeof(vector_type)); }
     7      };  
     8
     9  int main()
    10  {
    11    printf ("size = %d\n", sizeof(S < float >::vector_type));
    12    S<float> x;
    13    x.pr_size();
    14    return 0;
    15  }


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |17743
            Summary|vector keyword in typedef   |vector keyword in typedef
                   |inside struct ignored       |inside template struct
                   |                            |ignored


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
  2005-01-12 21:26 [Bug c++/19407] New: vector keyword in typedef inside struct ignored leblanc at skycomputers dot com
  2005-01-12 21:29 ` [Bug c++/19407] vector keyword in typedef inside template " leblanc at skycomputers dot com
@ 2005-01-12 21:31 ` pinskia at gcc dot gnu dot org
  2005-05-01  2:53 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-12 21:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-12 21:31 -------
Another example (which is rejected):
#include <stdio.h>
template < typename Val > struct S {
typedef Val vector_type __attribute__((vector_size(16)));
void pr_size() { printf ("size = %d\n", sizeof(vector_type)); }
};
int main()
{
printf ("size = %d\n", sizeof(S < float >::vector_type));
S<float> x;
x.pr_size();
return 0;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid, wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-12 21:31:53
               date|                            |


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
  2005-01-12 21:26 [Bug c++/19407] New: vector keyword in typedef inside struct ignored leblanc at skycomputers dot com
  2005-01-12 21:29 ` [Bug c++/19407] vector keyword in typedef inside template " leblanc at skycomputers dot com
  2005-01-12 21:31 ` pinskia at gcc dot gnu dot org
@ 2005-05-01  2:53 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-01  2:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-01 02:53 -------
Now we get an error:
t.cc:3: sorry, unimplemented: applying attributes to template parameters is not implemented

So this is definitely PR 17743

-- 


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
       [not found] <bug-19407-7048@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2007-09-23  2:39 ` jason at gcc dot gnu dot org
@ 2007-09-24 10:47 ` reichelt at gcc dot gnu dot org
  4 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-09-24 10:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
       [not found] <bug-19407-7048@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2007-09-23  2:36 ` jason at gcc dot gnu dot org
@ 2007-09-23  2:39 ` jason at gcc dot gnu dot org
  2007-09-24 10:47 ` reichelt at gcc dot gnu dot org
  4 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-23  2:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2007-09-23 02:39 -------
Fixed for 4.3.0.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |4.3.0
         Resolution|                            |FIXED


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
       [not found] <bug-19407-7048@http.gcc.gnu.org/bugzilla/>
  2006-08-26  4:26 ` pinskia at gcc dot gnu dot org
  2007-09-22 15:02 ` jason at gcc dot gnu dot org
@ 2007-09-23  2:36 ` jason at gcc dot gnu dot org
  2007-09-23  2:39 ` jason at gcc dot gnu dot org
  2007-09-24 10:47 ` reichelt at gcc dot gnu dot org
  4 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-23  2:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2007-09-23 02:36 -------
Subject: Bug 19407

Author: jason
Date: Sun Sep 23 02:36:34 2007
New Revision: 128681

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128681
Log:
        PR c++/19407
        * cp/cp-tree.h (ATTR_IS_DEPENDENT): New macro.
        (MAYBE_TAGGED_TYPE_P): Remove.
        * cp/pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
        instead of calling is_late_template_attribute again.
        (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
        (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
        Don't crash on typedefs from non-template classes.
        * cp/decl2.c (grokfield): Don't sorry about attrs on template parms.
        (is_late_template_attribute): All attributes applied to template
        parms or typename types are dependent.  Static, take decl.
        (splice_template_attributes): Pass decl through.
        (save_template_attributes): Likewise.
        * attribs.c (lookup_attribute_spec): Split out...
        (decl_attributes): From here.
        * tree.h: Declare it.

Added:
    trunk/gcc/testsuite/g++.dg/ext/tmplattr5.C
    trunk/gcc/testsuite/g++.dg/template/typedef7.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/attribs.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/g++.dg/ext/attrib20.C
    trunk/gcc/tree.h


-- 


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
       [not found] <bug-19407-7048@http.gcc.gnu.org/bugzilla/>
  2006-08-26  4:26 ` pinskia at gcc dot gnu dot org
@ 2007-09-22 15:02 ` jason at gcc dot gnu dot org
  2007-09-23  2:36 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-22 15:02 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-01-26 05:35:12         |2007-09-22 15:02:03
               date|                            |


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


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

* [Bug c++/19407] vector keyword in typedef inside template struct ignored
       [not found] <bug-19407-7048@http.gcc.gnu.org/bugzilla/>
@ 2006-08-26  4:26 ` pinskia at gcc dot gnu dot org
  2007-09-22 15:02 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-26  4:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-08-26 04:26 -------
This is not target specific.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|powerpc-linux-gnu           |


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


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

end of thread, other threads:[~2007-09-24 10:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 21:26 [Bug c++/19407] New: vector keyword in typedef inside struct ignored leblanc at skycomputers dot com
2005-01-12 21:29 ` [Bug c++/19407] vector keyword in typedef inside template " leblanc at skycomputers dot com
2005-01-12 21:31 ` pinskia at gcc dot gnu dot org
2005-05-01  2:53 ` pinskia at gcc dot gnu dot org
     [not found] <bug-19407-7048@http.gcc.gnu.org/bugzilla/>
2006-08-26  4:26 ` pinskia at gcc dot gnu dot org
2007-09-22 15:02 ` jason at gcc dot gnu dot org
2007-09-23  2:36 ` jason at gcc dot gnu dot org
2007-09-23  2:39 ` jason at gcc dot gnu dot org
2007-09-24 10:47 ` reichelt 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).