public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104577] New: needs copy constructor to call method of class non-type template parameter
@ 2022-02-17  3:55 f.heckenbach@fh-soft.de
  2022-02-18  1:14 ` [Bug c++/104577] needs copy constructor for " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: f.heckenbach@fh-soft.de @ 2022-02-17  3:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104577
           Summary: needs copy constructor to call method of class
                    non-type template parameter
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: f.heckenbach@fh-soft.de
  Target Milestone: ---

% cat test.cpp
struct S
{
  constexpr S () = default;
  S (S &&) = delete;
  operator int () const { return 0; }
};

template <S s> int i = s;

int main ()
{
  return i <S { }>;
}
% g++ -std=c++20 test.cpp
test.cpp:8:20: error: use of deleted function 'constexpr S::S(const S&)'
test.cpp:1:8: note: 'constexpr S::S(const S&)' is implicitly declared as
deleted because 'S' declares a move constructor or move assignment operator

I don't see why a copy constructor should be needed here. (clang accepts it.)

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

end of thread, other threads:[~2023-06-05 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17  3:55 [Bug c++/104577] New: needs copy constructor to call method of class non-type template parameter f.heckenbach@fh-soft.de
2022-02-18  1:14 ` [Bug c++/104577] needs copy constructor for " pinskia at gcc dot gnu.org
2022-12-26  4:19 ` mail at jhellings dot nl
2022-12-28  1:30 ` f.heckenbach@fh-soft.de
2023-02-11  4:35 ` herring at lanl dot gov
2023-06-05 19:29 ` ppalka 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).