This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17395] New: Incorrect lookup for parameters


G++ is confused about the scope of function paramaters.  
Here is a testcase

    template<int> struct X { };

    void fu(int a, X<sizeof(a)>) { }         // #1

    template<class T>
    void bhar(T a, X<sizeof(a)>) { }          // #2

    int main()
    {
       int x;
       X<sizeof(int)> y;
       fu(x, y);                             // #3
       bhar(x, y);                           // #4
    }

g++ erroneously rejects #1 and #2.

Notice that Comeau online accepts everything except #3 -- but
it should have accepted it.

-- 
           Summary: Incorrect lookup for parameters
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gdr at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: plateform independent


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]