public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27403]  New: T() can be an integer constant but is rejected as not one
@ 2006-05-02 21:12 pinskia at gcc dot gnu dot org
  2006-05-26 15:26 ` [Bug c++/27403] " bangerth at dealii dot org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-02 21:12 UTC (permalink / raw)
  To: gcc-bugs

Testcase:

template <int> struct A { typedef int I; };

template <class T>
typename A<T()  >::I foo (T) { return 0; }

-----
I found this while looking at PR 27402.  This is not a regression as it did not
work in 2.95 on wards.


-- 
           Summary: T() can be an integer constant but is rejected as not
                    one
           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=27403


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

* [Bug c++/27403] T() can be an integer constant but is rejected as not one
  2006-05-02 21:12 [Bug c++/27403] New: T() can be an integer constant but is rejected as not one pinskia at gcc dot gnu dot org
@ 2006-05-26 15:26 ` bangerth at dealii dot org
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth at dealii dot org @ 2006-05-26 15:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bangerth at dealii dot org  2006-05-26 15:26 -------
gcc parses this as

template <class T>
typename A<T (&)()  >::I foo (T) { return 0; }

i.e. as meaning that the argument is not an integer, but a function that
returns an integer.

A simpler testcase is this (icc accepts it, though I'm not sure who's right):
-------------------
template <int> struct A {};
A<int()> foo (int);
-------------------

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=27403


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

end of thread, other threads:[~2006-05-26 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02 21:12 [Bug c++/27403] New: T() can be an integer constant but is rejected as not one pinskia at gcc dot gnu dot org
2006-05-26 15:26 ` [Bug c++/27403] " bangerth at dealii 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).