public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27732]  New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list"
@ 2006-05-22 20:08 widman at gimpel dot com
  2006-05-22 22:46 ` [Bug c++/27732] " bangerth at dealii dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: widman at gimpel dot com @ 2006-05-22 20:08 UTC (permalink / raw)
  To: gcc-bugs

I get spurious errors from g++ in the following cases: 

// case 1:
int m;
template< int* p> struct A { };
template<> struct A<&(m)>;

// case 2:
int m;
template< int* p> struct A { };
template<> struct A<(&m)>;

Just a guess:  is there something about the parse of '(' that gums up the
works?


-- 
           Summary: Parentheses elicit spurious error: "missing '>' to
                    terminate the template argument list"
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: widman at gimpel dot com


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


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

* [Bug c++/27732] Parentheses elicit spurious error: "missing '>' to terminate the template argument list"
  2006-05-22 20:08 [Bug c++/27732] New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list" widman at gimpel dot com
@ 2006-05-22 22:46 ` bangerth at dealii dot org
  2006-05-23 15:10 ` widman at gimpel dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2006-05-22 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bangerth at dealii dot org  2006-05-22 22:46 -------
Confirmed. I guess the workaround is to simply not use the parenthesis.

Nevertheless, this is a regression introduced with the new parser in 3.4.0.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
      Known to fail|                            |3.4.2 4.0.2
      Known to work|                            |3.3.4
           Priority|P3                          |P2
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-22 22:46:05
               date|                            |
   Target Milestone|---                         |4.1.2


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


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

* [Bug c++/27732] Parentheses elicit spurious error: "missing '>' to terminate the template argument list"
  2006-05-22 20:08 [Bug c++/27732] New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list" widman at gimpel dot com
  2006-05-22 22:46 ` [Bug c++/27732] " bangerth at dealii dot org
@ 2006-05-23 15:10 ` widman at gimpel dot com
  2006-09-17 19:30 ` [Bug c++/27732] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: widman at gimpel dot com @ 2006-05-23 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from widman at gimpel dot com  2006-05-23 15:10 -------
By the way: whoever tackles this may also want to take a look at: 

template< int* p> struct A { };
template<> struct A<(int*)0>;

...which was made permissible by the recently-adopted wording that was proposed
for Defect Report 354:

http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2006/n1998.html#354


-- 


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


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

* [Bug c++/27732] [4.0/4.1/4.2 Regression] Parentheses elicit spurious error: "missing '>' to terminate the template argument list"
  2006-05-22 20:08 [Bug c++/27732] New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list" widman at gimpel dot com
  2006-05-22 22:46 ` [Bug c++/27732] " bangerth at dealii dot org
  2006-05-23 15:10 ` widman at gimpel dot com
@ 2006-09-17 19:30 ` pinskia at gcc dot gnu dot org
  2006-10-16 23:25 ` [Bug c++/27732] [4.0 " mmitchel at gcc dot gnu dot org
  2007-02-03 17:22 ` gdr at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-17 19:30 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
            Summary|Parentheses elicit spurious |[4.0/4.1/4.2 Regression]
                   |error: "missing '>' to      |Parentheses elicit spurious
                   |terminate the template      |error: "missing '>' to
                   |argument list"              |terminate the template
                   |                            |argument list"
   Target Milestone|4.1.2                       |4.0.4


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


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

* [Bug c++/27732] [4.0 Regression] Parentheses elicit spurious error: "missing '>' to terminate the template argument list"
  2006-05-22 20:08 [Bug c++/27732] New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list" widman at gimpel dot com
                   ` (2 preceding siblings ...)
  2006-09-17 19:30 ` [Bug c++/27732] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-10-16 23:25 ` mmitchel at gcc dot gnu dot org
  2007-02-03 17:22 ` gdr at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-16 23:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2006-10-16 23:25 -------
James --

Case #1 in Comment #1 is accepted by current G++ 4.1 and mainline branches.  I
do not believe Case #2 is valid, as the standard says that a non-type template
argument may be:

    the address of an object or function with external linkage,  includ-
    ing  function templates and function template-ids but excluding non-
    static class members, expressed as & id-expression

Thus, the parentheses make this case invalid.  Admittedly, that's pedantic, but
I think that's what the standard says.

Comment #3 is a separate enhancement request, and should be refiled separately.

Thanks,

-- Mark


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.0/4.1/4.2 Regression]    |[4.0 Regression] Parentheses
                   |Parentheses elicit spurious |elicit spurious error:
                   |error: "missing '>' to      |"missing '>' to terminate
                   |terminate the template      |the template argument list"
                   |argument list"              |


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


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

* [Bug c++/27732] [4.0 Regression] Parentheses elicit spurious error: "missing '>' to terminate the template argument list"
  2006-05-22 20:08 [Bug c++/27732] New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list" widman at gimpel dot com
                   ` (3 preceding siblings ...)
  2006-10-16 23:25 ` [Bug c++/27732] [4.0 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 17:22 ` gdr at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gdr at gcc dot gnu dot org  2007-02-03 17:22 -------
Fixed in GCC-4.1.0.
Won't fix in GCC-4.0.x.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.0


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


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

end of thread, other threads:[~2007-02-03 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-22 20:08 [Bug c++/27732] New: Parentheses elicit spurious error: "missing '>' to terminate the template argument list" widman at gimpel dot com
2006-05-22 22:46 ` [Bug c++/27732] " bangerth at dealii dot org
2006-05-23 15:10 ` widman at gimpel dot com
2006-09-17 19:30 ` [Bug c++/27732] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-10-16 23:25 ` [Bug c++/27732] [4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 17:22 ` gdr 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).