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++/17161] New: failure to diagnose an ill-formed instantiation on a local type


Gcc 3.4 fails to diagnose the following ill-formed program.

$ cat t.cpp && g++ --version && g++ t.cpp -Wextra -W -pedantic
struct S {
    void foo (unsigned long) { }
    template <class T> void foo (T) { }
};

int main ()
{
    enum E { e };

    S ().foo (e);   // local types are not allowed as template arguments
}

g++ (GCC) 3.4.0
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-- 
           Summary: failure to diagnose an ill-formed instantiation on a
                    local type
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


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


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