There is no way for a program to refer to the template constructor defined
in the class below.  EDG eccp issues a warning to point this out, but gcc
silently accepts the code.  It would be helpful if gcc were enhanced to
issue a similar diagnostic.

$ cat t.cpp && gcc -dumpversion && gcc -W -Wall -Wextra -pedantic -c t.cpp &&
eccp -c -v t.cpp
struct S { template <class> S () { } };
4.4.1
Edison Design Group C/C++ Front End, version 3.10.1 (Apr 22 2008 17:02:08)
Copyright 1988-2007 Edison Design Group, Inc.

"t.cpp", line 1: warning: template parameter "<unnamed>" is not used in
          declaring the parameter types of function template "S::S"
  struct S { template <class> S () { } };
                            ^


-- 
           Summary: missing warning for an uncallable function template
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: msebor at gmail dot com


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

Reply via email to