public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14383] New: Class member incorrectly treated as template-name in function template
@ 2004-03-02 13:52 timb at bluearc dot com
  2004-03-02 14:07 ` [Bug c++/14383] " bangerth at dealii dot org
  2004-07-13 17:03 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: timb at bluearc dot com @ 2004-03-02 13:52 UTC (permalink / raw)
  To: gcc-bugs

Feed this snippet to gcc -c :

----- test.cpp
struct t;

struct A
{
    int t;
};

template <typename> void f(A a)
{
    a.t < 0;
}
-----

It says:

test.cpp: In function `void f(A)':
test.cpp:10: error: parse error before `;' token

It seems to be taking a.t to be a template name, and therefore < as the start 
of a template argument list instead of less-than. a.t is not a template 
(whether or not there is also a struct t), so this is wrong. The problem does 
not appear if f is not itself templated.

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian)

-- 
           Summary: Class member incorrectly treated as template-name in
                    function template
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: timb at bluearc dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-pc-linux-gnu
  GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu


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


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

* [Bug c++/14383] Class member incorrectly treated as template-name in function template
  2004-03-02 13:52 [Bug c++/14383] New: Class member incorrectly treated as template-name in function template timb at bluearc dot com
@ 2004-03-02 14:07 ` bangerth at dealii dot org
  2004-07-13 17:03 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bangerth at dealii dot org @ 2004-03-02 14:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-02 14:07 -------
What an interesting feature, and how funny that this is the first 
time I see this bug. 
 
Alas, this is fixed in mainline and 3.4, and since I get the same 
failure back to 2.95, this is also not a regression. In other words, 
it is not going to be fixed in 3.3.x. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |rejects-valid
      Known to fail|                            |2.95.3 3.2.3 3.3.3
      Known to work|                            |3.4.0 3.5.0
         Resolution|                            |FIXED


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


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

* [Bug c++/14383] Class member incorrectly treated as template-name in function template
  2004-03-02 13:52 [Bug c++/14383] New: Class member incorrectly treated as template-name in function template timb at bluearc dot com
  2004-03-02 14:07 ` [Bug c++/14383] " bangerth at dealii dot org
@ 2004-07-13 17:03 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-13 17:03 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4.0


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


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

end of thread, other threads:[~2004-07-13 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-02 13:52 [Bug c++/14383] New: Class member incorrectly treated as template-name in function template timb at bluearc dot com
2004-03-02 14:07 ` [Bug c++/14383] " bangerth at dealii dot org
2004-07-13 17:03 ` 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).