public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37736]  New: Problem with designated initializer and template
@ 2008-10-05  6:50 simartin at gcc dot gnu dot org
  2009-03-28 20:14 ` [Bug c++/37736] " reichelt at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: simartin at gcc dot gnu dot org @ 2008-10-05  6:50 UTC (permalink / raw)
  To: gcc-bugs

Opened from comment 4 in PR29727.

The following valid snipped is rejected with the current mainline

===
template<int> struct A
{
  struct S { int X; };
  static S a;
};

template<int N> typename A<N>::S A<N>::a = { X : 1 };

void foo()
{
  A<0>::a;
}
===

because 'X' is not found in the designated initializer:

[...]
  pr29727_valid.C:18: error: 'Y' was not declared in this scope
  pr29727_valid.C:18: error: 'B<0>::S' has no non-static data member named
'<declaration error>'


We get the same with 4.0.1, 4.2.1 and the 4.3 branch. I don't have any earlier
version to check, so I don't know if this is a regression or not.

With a non template class, the code is accepted.


-- 
           Summary: Problem with designated initializer and template
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simartin at gcc dot gnu dot org


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


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

* [Bug c++/37736] Problem with designated initializer and template
  2008-10-05  6:50 [Bug c++/37736] New: Problem with designated initializer and template simartin at gcc dot gnu dot org
@ 2009-03-28 20:14 ` reichelt at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-03-28 20:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from reichelt at gcc dot gnu dot org  2009-03-28 20:14 -------
Confirmed (also by Paolo in PR29727).
This is rejected since at least GCC 2.95.3.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |monitored
   Last reconfirmed|0000-00-00 00:00:00         |2009-03-28 20:14:28
               date|                            |


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


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

* [Bug c++/37736] Problem with designated initializer and template
       [not found] <bug-37736-4@http.gcc.gnu.org/bugzilla/>
@ 2013-05-14 15:53 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 3+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-05-14 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|gcc-bugs at gcc dot gnu.org        |
         Resolution|---                         |DUPLICATE

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Another Dup.

*** This bug has been marked as a duplicate of bug 57041 ***


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

end of thread, other threads:[~2013-05-14 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-05  6:50 [Bug c++/37736] New: Problem with designated initializer and template simartin at gcc dot gnu dot org
2009-03-28 20:14 ` [Bug c++/37736] " reichelt at gcc dot gnu dot org
     [not found] <bug-37736-4@http.gcc.gnu.org/bugzilla/>
2013-05-14 15:53 ` paolo.carlini at oracle dot com

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