public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113884] New: GCC rejects valid program saying ambiguous call when using std::vector
@ 2024-02-12  4:51 jlame646 at gmail dot com
  2024-02-12  4:58 ` [Bug c++/113884] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jlame646 at gmail dot com @ 2024-02-12  4:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113884

            Bug ID: 113884
           Summary: GCC rejects valid program saying ambiguous call when
                    using std::vector
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following valid program is rejected by gcc
```
#include <type_traits>
#include <vector>

struct A {
    A();
};


void func(std::vector<double> values);
void func(std::vector<A> as);

int main() {
    func({ 4.2 }); //gcc rejects this
}
```

One way to see that gcc is incorrect here is by just removing the first
overload and then gcc also starts rejecting this, implying the the second
overload is not even viable so how can it make the call ambiguous.

```
#include <type_traits>
#include <vector>

struct A {
    A();
};


void func(std::vector<A> as);

int main() {
    func({ 4.2 });//now gcc also starts correctly rejecting this implying that
this is not even viable so how can it possibly make the call ambiguous 
}
```

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-12  7:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12  4:51 [Bug c++/113884] New: GCC rejects valid program saying ambiguous call when using std::vector jlame646 at gmail dot com
2024-02-12  4:58 ` [Bug c++/113884] " pinskia at gcc dot gnu.org
2024-02-12  5:01 ` pinskia at gcc dot gnu.org
2024-02-12  5:03 ` pinskia at gcc dot gnu.org
2024-02-12  5:18 ` jlame646 at gmail dot com
2024-02-12  5:22 ` pinskia at gcc dot gnu.org
2024-02-12  5:25 ` pinskia at gcc dot gnu.org
2024-02-12  5:47 ` jlame646 at gmail dot com
2024-02-12  5:59 ` pinskia at gcc dot gnu.org
2024-02-12  7:58 ` jlame646 at gmail dot com

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).