public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/111511] New: Incorrect ADL in std::to_array in GCC 11/12/13
@ 2023-09-21  6:17 de34 at live dot cn
  2023-09-21  8:03 ` [Bug libstdc++/111511] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: de34 at live dot cn @ 2023-09-21  6:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111511
           Summary: Incorrect ADL in std::to_array in GCC 11/12/13
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: de34 at live dot cn
  Target Milestone: ---

The following program is incorrectly rejected when using libstdc++
(https://godbolt.org/z/x6K6r5svM).

```
#include <array>
#include <utility>

struct incomplete;

template<class T>
struct holder {
    T t;
};

using validator = holder<incomplete>*;

int main()
{
    validator a[1]{};
    (void) std::to_array(a);
    (void) std::to_array(std::move(a));
}
```

The error is caused by aunqualified calls to the `__to_array` internal
function, which triggers ADL for `incomplete` and requires it to be complete.

Not sure whether this should be WONTFIX since the implementation is
fundamentally changed in GCC 14 (PR 110167).

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

end of thread, other threads:[~2023-09-27 16:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-21  6:17 [Bug libstdc++/111511] New: Incorrect ADL in std::to_array in GCC 11/12/13 de34 at live dot cn
2023-09-21  8:03 ` [Bug libstdc++/111511] " redi at gcc dot gnu.org
2023-09-21 10:33 ` m.cencora at gmail dot com
2023-09-21 10:42 ` redi at gcc dot gnu.org
2023-09-21 10:45 ` m.cencora at gmail dot com
2023-09-21 11:37 ` de34 at live dot cn
2023-09-25  8:53 ` cvs-commit at gcc dot gnu.org
2023-09-26 20:15 ` cvs-commit at gcc dot gnu.org
2023-09-26 22:55 ` cvs-commit at gcc dot gnu.org
2023-09-27 16:21 ` cvs-commit at gcc dot gnu.org
2023-09-27 16:23 ` redi 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).