From -3739802581027905081
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: Lisa Lippincott <lisa_lippincott@advisories.com>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/23
Message-ID: <230819991621180849%lisa_lippincott@advisories.com>#1/1
X-Deja-AN: 516370903
X-NNTP-Posting-Host: 38.168.253.3
Content-Transfer-Encoding: 8bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <7ol6hi$ej9$2@news.BelWue.DE> <cTiioXAhAwr3Ew$X@robinton.demon.co.uk> <t7d7ww1vrz.fsf@calumny.jyacc.com> <e4DSyfA4ALs3Ew0Q@robinton.demon.co.uk> <t7r9laz5hj.fsf@calumny.jyacc.com> <7oup0a$8g2$1@nnrp1.deja.com> <37B3C2AD.5AB722AE@lucent.com> <37B5A571.449B@wanadoo.fr> <37B908A8.717CAC2C@lucent.com> <CVJFZFAbaWu3Ew15@robinton.demon.co.uk> <7pcvjs$tk4$1@nnrp1.deja.com> <user-1808991258230001@aus-as3-121.io.com> <7phk8n$b26$1@nnrp1.deja.com> <37BD2185.C0047293@physik.tu-muenchen.de> <7pk6r6$689$1@nnrp1.deja.com> <37C1B67F.B5B0B51A@cds.duke.edu>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=Macintosh
X-Trace: client 935450252 38.168.253.3 (Mon, 23 Aug 1999 19:17:32 EDT)
Organization: -
Mime-Version: 1.0
User-Agent: YA-NewsWatcher/4.2.2
NNTP-Posting-Date: Mon, 23 Aug 1999 19:17:32 EDT
Newsgroups: comp.std.c++
Originator: clamage@taumet


Here's a potential trouble spot with typeof: it allows a program to refer
to unnamed classes and enums, which may cause havoc with linkage.
Consider:

enum {a};
enum {b};
void f( typeof(a) );
void f( typeof(b) );

What are the linkage names of the functions f?

This problem could be avoided by adding (perhaps to 3.5 paragraph 8)

    Class and enum types without names shall not be used to declare
    an entity with linkage, unless the type is defined in a typedef
    declaration and has the typedef name for linkage purposes.

I think this statement follows from the current standard, but the
typeof proposal as it stands would allow it to be violated.


                                                   --Lisa Lippincott


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




