Movatterモバイル変換


[0]ホーム

URL:


Issue 83 - WG21 CWG Issues
Title
Overloading and deprecated conversion of string literal
Status
tc1
Section
12.2.4.3 [over.ics.rank]
Submitter
Steve Adamczyk

Created on1999-01-24.00:00:00 last changed277 months ago

Messages

msg229 (view)
Date: 2000-10-15.00:00:00

Proposed resolution (10/00):

Change12.2.4.3 [over.ics.rank] bullet 3.1sub-bullet 3 from

S1 andS2 differ only in their qualificationconversion and yield similar typesT1 andT2(7.3.6 [conv.qual]), respectively, and thecv-qualification signature of typeT1 is a proper subset ofthe cv-qualification signature of typeT2.
to
S1 andS2 differ only in their qualificationconversion and yield similar typesT1 andT2(7.3.6 [conv.qual]), respectively, and thecv-qualification signature of typeT1 is a proper subset ofthe cv-qualification signature of typeT2, andS1 isnot the deprecated string literal array-to-pointer conversion(7.3.3 [conv.array]).
msg154 (view)
Date: 2003-04-25.00:00:00

In12.2.4.3 [over.ics.rank], we have

  • S1 andS2 differ only in theirqualification conversion andyield similar typesT1 andT2(7.3.6 [conv.qual]),respectively, and the cv-qualification signature of typeT1is a propersubset of the cv-qualification signature of typeT2,[Example:
        int f(const int *);    int f(int *);    int i;    int j = f(&i); //Calls f(int *)
    end example] or, if not that,
This does not work right with respect to the deprecated conversion fromstring literal to "char *". Consider
    void f(char *);    void f(const char *);    f("abc");
The two conversion sequences differ only in their qualification conversions,and the destination types are similar. The cv-qualification signature of"char *", is a proper subset of the cv-qualification signatureof "const char *", sof(char *) is chosen, which is wrong.The rule should be like the one for conversion to bool — the deprecatedconversion should be worse than another exact match that is not the deprecatedconversion.
History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: review -> ready
2000-02-23 00:00:00adminsetmessages: +msg229
2000-02-23 00:00:00adminsetstatus: open -> review
1999-01-24 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp