https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #11 from Andris Pavenis ---
OK. New version:
20220203-1.cpp: In function 'int main()':
20220203-1.cpp:19:24: warning: suspicious use of overloaded 'Test(const char
[4], const char[4])'
21 | Test test("foo", "bar");
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #9 from Andris Pavenis ---
>> The warning should be in case when both
>> 1) there is preferred standard conversion sequence for parameter of one
>> overloaded method
>
>Standard conversions include T -> const T&, and derived-to-base
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #8 from Jonathan Wakely ---
(In reply to Andris Pavenis from comment #5)
> The warning should be in case when both
> 1) there is preferred standard conversion sequence for parameter of one
> overloaded method
Standard conversions in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
Jonathan Wakely changed:
What|Removed |Added
Ever confirmed|1 |0
Status|WAITING
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #6 from Andris Pavenis ---
Suggested format (changed types to get real ambiguity and edited generated
message):
20220203-1.cpp: In function 'int main()':
20220203-1.cpp:19:24: warning: call of overloaded 'Test(const char [4],
unsign
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #5 from Andris Pavenis ---
The warning should be in case when both
1) there is preferred standard conversion sequence for parameter of one
overloaded method
2) there is other user defined conversion sequences for one more more other
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #4 from Jonathan Wakely ---
Your original testcase shows one example where you want a warning, but that's
not a specification. Should it only warn when std::string and bool are
involved, and there's a char* argument? Or should it be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
Jonathan Wakely changed:
What|Removed |Added
Last reconfirmed||2022-02-03
Status|UNCONFI
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
Richard Biener changed:
What|Removed |Added
Severity|normal |enhancement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
--- Comment #2 from Andris Pavenis ---
OK. Then warning would be nice.
Otherwise it is a trap when one chooses to add bool parameter at end after
string
parameter and other overloaded method with one more string parameter at end is
also presen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104365
Andrew Pinski changed:
What|Removed |Added
Keywords||diagnostic
--- Comment #1 from Andrew P
12 matches
Mail list logo