public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115000] New: Confusing 'cannot convert to 'int' in initialization' error message
@ 2024-05-09 3:28 hewillk at gmail dot com
2024-05-09 3:32 ` [Bug c++/115000] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: hewillk at gmail dot com @ 2024-05-09 3:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115000
Bug ID: 115000
Summary: Confusing 'cannot convert to 'int' in initialization'
error message
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
Consider the following:
#include <ranges>
struct S {
S() = default;
S(S&&) = default;
};
S s;
std::ranges::single_view<S> r{s};
https://godbolt.org/z/65nvdaTfP
GCC reports constraints not satisfied which is correct, however, there is more:
<source>:9:31: error: cannot convert 'S' to 'int' in initialization
9 | std::ranges::single_view<S> r{s};
| ^
| |
| S
This is confusing since there is nothing to do with 'int'.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/115000] Confusing 'cannot convert to 'int' in initialization' error message
2024-05-09 3:28 [Bug c++/115000] New: Confusing 'cannot convert to 'int' in initialization' error message hewillk at gmail dot com
@ 2024-05-09 3:32 ` pinskia at gcc dot gnu.org
2024-05-09 3:33 ` pinskia at gcc dot gnu.org
2024-05-09 3:41 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-09 3:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115000
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2024-05-09
Keywords| |error-recovery
Status|UNCONFIRMED |NEW
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. There is another issue like this. Basically the C++ front-end uses
int as a valid type after an error.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/115000] Confusing 'cannot convert to 'int' in initialization' error message
2024-05-09 3:28 [Bug c++/115000] New: Confusing 'cannot convert to 'int' in initialization' error message hewillk at gmail dot com
2024-05-09 3:32 ` [Bug c++/115000] " pinskia at gcc dot gnu.org
@ 2024-05-09 3:33 ` pinskia at gcc dot gnu.org
2024-05-09 3:41 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-09 3:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115000
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced:
```
template<class T>
concept bool c = false;
template<c T>
struct ts{};
struct S {};
S s;
ts<S> t33{s};
```
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/115000] Confusing 'cannot convert to 'int' in initialization' error message
2024-05-09 3:28 [Bug c++/115000] New: Confusing 'cannot convert to 'int' in initialization' error message hewillk at gmail dot com
2024-05-09 3:32 ` [Bug c++/115000] " pinskia at gcc dot gnu.org
2024-05-09 3:33 ` pinskia at gcc dot gnu.org
@ 2024-05-09 3:41 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-09 3:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115000
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect all of the see also bugs here are the same issue, I described my try
of fixing that in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104113#c8 .
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-09 3:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-09 3:28 [Bug c++/115000] New: Confusing 'cannot convert to 'int' in initialization' error message hewillk at gmail dot com
2024-05-09 3:32 ` [Bug c++/115000] " pinskia at gcc dot gnu.org
2024-05-09 3:33 ` pinskia at gcc dot gnu.org
2024-05-09 3:41 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).