[Bug c++/32058] New: invalid computed void parameter in template

2007-05-23 Thread paul_m_doc at hotmail dot com
Can't return void from type function instantiation with dependent args for use
in function declaration.

all versions from 3.4 to the latest 4.3.0 build on x86 cygwin/linux complain
with:

error: invalid parameter type 'void'
...

=

template 
struct F { typedef void Type; };

template 
struct X {

   // does not accept dependent computed type void!
   // (void* is fine as is non-dependent F<0>::Type)

   typedef typename F::Type ParmT;

   static int func(ParmT) { return 1; }
};

int main()
{
   int i = X<0>::func();
}



The VisualC++ compilers are fine.


-- 
   Summary: invalid computed void parameter in template
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paul_m_doc at hotmail dot com


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



[Bug c++/9278] Illegal use of typedef to "void"

2007-05-25 Thread paul_m_doc at hotmail dot com


--- Comment #27 from paul_m_doc at hotmail dot com  2007-05-25 13:11 ---
(In reply to comment #26)
> *** Bug 32058 has been marked as a duplicate of this bug. ***

Sigh :(. The response at the October 2006 to DR 577 is enough to make any
template meta-programmer bang their head against the wall in despair.

This is the language that, according to its creator as a design goal should
'trust the programmer', right?

I certainly have a formal position on this and many other similar issues that
affect TMP.

This should have been at most a warning with the option to turn it off.

The Visual C++ compilers may be less fussy than gcc but at least they tend to
do the sensible thing.


-- 


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