public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103659] New: Declared function template can be deleted later
@ 2021-12-11  5:34 fchelnokov at gmail dot com
  2021-12-11  5:36 ` [Bug c++/103659] " pinskia at gcc dot gnu.org
  2021-12-11  5:38 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: fchelnokov at gmail dot com @ 2021-12-11  5:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103659
           Summary: Declared function template can be deleted later
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This code
```
template<class T>
int foo(T);

template int foo(int);

template<class T>
int foo(T) = delete;
```
is currently accepted by GCC, but it must not by at least two reasons:
* explicit instantiation of undefined function;
* deletion of already declared function.

Demo: https://gcc.godbolt.org/z/EW8fvba5f

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

* [Bug c++/103659] Declared function template can be deleted later
  2021-12-11  5:34 [Bug c++/103659] New: Declared function template can be deleted later fchelnokov at gmail dot com
@ 2021-12-11  5:36 ` pinskia at gcc dot gnu.org
  2021-12-11  5:38 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-11  5:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 90703.

*** This bug has been marked as a duplicate of bug 90703 ***

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

* [Bug c++/103659] Declared function template can be deleted later
  2021-12-11  5:34 [Bug c++/103659] New: Declared function template can be deleted later fchelnokov at gmail dot com
  2021-12-11  5:36 ` [Bug c++/103659] " pinskia at gcc dot gnu.org
@ 2021-12-11  5:38 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-11  5:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Dup of bug 90703.

The only reason I knew there was a dup is because I just saw it today when I
was going through the C++ bug reports. So I was not doing any magical memory
since it was only from today.

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

end of thread, other threads:[~2021-12-11  5:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11  5:34 [Bug c++/103659] New: Declared function template can be deleted later fchelnokov at gmail dot com
2021-12-11  5:36 ` [Bug c++/103659] " pinskia at gcc dot gnu.org
2021-12-11  5:38 ` 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).