public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28766]  New:  compound literal expression vs templates
@ 2006-08-18  3:28 pinskia at gcc dot gnu dot org
  2006-08-18  3:30 ` [Bug c++/28766] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-18  3:28 UTC (permalink / raw)
  To: gcc-bugs

The following should be able to compile but does not:
struct A { int i; };

template<int t>
void foo()
{
    ((struct A) { 0 }).i += 1;
}

void g(void)
{
  foo<0>();
}

--------
If we remove the template on foo, the statement with compund literal expression
is accepted.


-- 
           Summary:  compound literal expression vs templates
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
@ 2006-08-18  3:30 ` pinskia at gcc dot gnu dot org
  2006-08-24  1:57 ` bangerth at dealii dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-18  3:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-08-18 03:30 -------
This is not a regression as far as I can tell.
Note I found this while working on PR 28418.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |2.95.3 3.0.4 3.2.2 3.2.3
                   |                            |3.3.1 4.0.0 3.4.0 4.2.0
            Summary| compound literal expression|compound literal expression
                   |vs templates                |vs templates


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
  2006-08-18  3:30 ` [Bug c++/28766] " pinskia at gcc dot gnu dot org
@ 2006-08-24  1:57 ` bangerth at dealii dot org
  2006-08-24  3:29 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2006-08-24  1:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bangerth at dealii dot org  2006-08-24 01:57 -------
It doesn't seem to matter for me whether the function is a template or
not. Which version did you use to get to that statement?

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
  2006-08-18  3:30 ` [Bug c++/28766] " pinskia at gcc dot gnu dot org
  2006-08-24  1:57 ` bangerth at dealii dot org
@ 2006-08-24  3:29 ` pinskia at gcc dot gnu dot org
  2006-10-12  1:45 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-24  3:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-08-24 03:29 -------
(In reply to comment #2)
> It doesn't seem to matter for me whether the function is a template or
> not. Which version did you use to get to that statement?

4.2.0 20060821 works without the template in that the following works:
struct A { int i; };

void foo()
{
    ((struct A) { 0 }).i += 1;
}


-- 


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-08-24  3:29 ` pinskia at gcc dot gnu dot org
@ 2006-10-12  1:45 ` bangerth at dealii dot org
  2009-04-16 17:02 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2006-10-12  1:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bangerth at dealii dot org  2006-10-12 01:45 -------
Confirmed. The template version doesn't compile, whereas the non-template
version does.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-12 01:45:19
               date|                            |


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-10-12  1:45 ` bangerth at dealii dot org
@ 2009-04-16 17:02 ` pinskia at gcc dot gnu dot org
  2009-04-16 17:03 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2009-04-16 17:02 -------
Fixed in at least 4.4.0 and above.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-04-16 17:02 ` pinskia at gcc dot gnu dot org
@ 2009-04-16 17:03 ` pinskia at gcc dot gnu dot org
  2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
  2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 17:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2009-04-16 17:03 -------
Mine to commit the testcase.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-04-16 17:03 ` pinskia at gcc dot gnu dot org
@ 2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
  2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 17:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2009-04-16 17:07 -------
Subject: Bug 28766

Author: pinskia
Date: Thu Apr 16 17:07:06 2009
New Revision: 146203

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146203
Log:
2009-04-16  Andrew Pinski  <pinskia@gmail.com>

        PR C++/28766
        * g++.dg/ext/complit11.C: New testcase.



Added:
    trunk/gcc/testsuite/g++.dg/ext/complit11.C
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/28766] compound literal expression vs templates
  2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
@ 2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 17:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2009-04-16 17:07 -------
Fixed so closing.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-04-16 17:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-18  3:28 [Bug c++/28766] New: compound literal expression vs templates pinskia at gcc dot gnu dot org
2006-08-18  3:30 ` [Bug c++/28766] " pinskia at gcc dot gnu dot org
2006-08-24  1:57 ` bangerth at dealii dot org
2006-08-24  3:29 ` pinskia at gcc dot gnu dot org
2006-10-12  1:45 ` bangerth at dealii dot org
2009-04-16 17:02 ` pinskia at gcc dot gnu dot org
2009-04-16 17:03 ` pinskia at gcc dot gnu dot org
2009-04-16 17:07 ` pinskia at gcc dot gnu dot org
2009-04-16 17:07 ` 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).