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++/11857] New: Array of T=void allowed as function parameter type when T is a template parameter


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Array of T=void allowed as function parameter type when
                    T is a template parameter
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gccbugs at contacts dot eelis dot net
                CC: gcc-bugs at gcc dot gnu dot org

Arrays of void are not allowed (8.3.4 para 1). However, GCC fails to detect
these when the void element type is a template parameter. GCC compiles the
following code without errors:

template <typename T> void f (T []);
void g () { f<void>(0); }

Comeau does detect this, and says: "error: array of void is not allowed".

I'm using GCC version 3.4 20030723.


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