Bug 15949 - Error using a qualified-id in a function template
Summary: Error using a qualified-id in a function template
Status: RESOLVED DUPLICATE of bug 15875
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-11 21:08 UTC by apl
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
simple test case (268 bytes, text/plain)
2004-06-11 21:10 UTC, apl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description apl 2004-06-11 21:08:22 UTC
Using a pointer-to-member call referring to a virtual member function inside a
templated function results in the error: 


invalid use of ' NUNetRef::overlaps' to form a pointer-to-member-function.  Use
a qualified-id.


The example compiles in 3.3.3 and 3.4.0 but doesn't compile in 3.4-20040604.  If
I make the templated function a regular function, it compiles without error.

<example checked in momentarily>
Comment 1 apl 2004-06-11 21:10:15 UTC
Created attachment 6521 [details]
simple test case
Comment 2 apl 2004-06-11 21:15:44 UTC
If I change the collision function to not be templated ala

  bool collision (NUNetRef&a, NUNetRef& b) {
    int dummy;
    NUNetRefCompareFunction f = &NUNetRef::overlaps;

    return (a.*f)(b);
  }

Then it compiles without error.
Comment 3 Andrew Pinski 2004-06-11 21:18:08 UTC
This is a dup of bug 15875 which is fixed by reverting the patch which caused this regression.

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

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