From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13440 invoked by alias); 10 Aug 2004 01:35:57 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13401 invoked by alias); 10 Aug 2004 01:35:57 -0000 Date: Tue, 10 Aug 2004 01:35:00 -0000 Message-ID: <20040810013557.13400.qmail@sourceware.org> From: "gdr at integrable-solutions dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030603112812.11078.jtotland1@chello.no> References: <20030603112812.11078.jtotland1@chello.no> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/11078] [ABI] ICE in write_type with typeof and templates X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg00765.txt.bz2 List-Id: ------- Additional Comments From gdr at integrable-solutions dot net 2004-08-10 01:35 ------- Subject: Re: [ABI] ICE in write_type with typeof and templates "giovannibajo at libero dot it" writes: | Subject: Re: [ABI] ICE in write_type with typeof and templates | | gdr at integrable-solutions dot net wrote: | | >> buy us anything. Plus, I don't think we want to say that the | >> following declarations are declaring two different functions: | >> | >> void foo(typeof(int*)); | >> void foo(int*); | >> | >> or these: | >> | >> void bar(typeof(typeof(char*) [4]) blah); | >> void bar(char *blah[4]); | > | > As I said before, the problem is inexistent for ordinary functions | > because we don't care about the retun type of those. | > The issue is with function templates, and there we do care. | > So I don't believe in arguments based on ordinary functions to strip | > out typeof. | | I am not speaking of return types (only) here. I am speaking of the mangling of | typeof(), wherever it appears in a mangled part of a function signature. The issue is of interest only for function templates. For non-templates, it is moot. It is moot for non-templates because we always use the normal form of their signatures. For templates, we use their token streams, where the problem come to interest. | Anyway, in case I am missing something, the same argument can be brought for | template functions. I suggest we mangle each element in the following couple | (or better -- each instantiation with the same set of arguments) with the same | name: | | template void foo(typeof(int*)); | template void foo(int*); | | template void foo(typeof(typeof(T*)[4]) blah); | template void foo(T *blah[4]); These two declarations are not equivalent, as the template parameter in the first declaration appears in non-deducible context whereas it is deducible in the second. If they are not equivalent, you cannot decide that they will mangle the same, for the very same reasons I outlined before. And it is very easy to construct examples where you screw up things, just like in my previous messages. If you insist in mangling them the same, there are modifications to the current semantics you ought to make before getting to that point. Also notice that currently, we have no problem mangling the above. [...] | My conclusion is the same as before: | | >> In other words, we can easily strip typeof(type) while mangling, and | >> encoding typeof(expr) as Y E. In the current state of affairs, that would be an ill-informed thing to do. And I would strongly advise against. -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11078