public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60753] New: defining an explicit function template specialization as deleted, following a non-deleted declaration, not diagnosted
@ 2014-04-03 23:22 filip.roseen at gmail dot com
  2014-11-26 17:13 ` [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted paolo.carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: filip.roseen at gmail dot com @ 2014-04-03 23:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60753

            Bug ID: 60753
           Summary: defining an explicit function template specialization
                    as deleted, following a non-deleted declaration, not
                    diagnosted
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: filip.roseen at gmail dot com

Created attachment 32537
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32537&action=edit
testcase.cpp

template<class T> void func (T);

template<> void func<int> (int);
template<> void func<int> (int) = delete;

int main () { }

------------------------------------------------------------------------

`gcc` accepts the above snippet.

------------------------------------------------------------------------

The previous snippet is ill-formed according to [dcl.fct.def.delete]p4:

  > A deleted definition of a function shall be the first declaration
  > of the function or, for an explicit specialization of a function
  > template, the first declaration of that specialization.

------------------------------------------------------------------------

`clang` correctly issues the following diagnostic:

testcase.cpp:4:35: error: deleted definition must be first declaration
template<> void func<int> (int) = delete;
                                  ^
testcase.cpp:3:17: note: previous declaration is here
template<> void func<int> (int);
                ^

------------------------------------------------------------------------


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

* [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted
  2014-04-03 23:22 [Bug c++/60753] New: defining an explicit function template specialization as deleted, following a non-deleted declaration, not diagnosted filip.roseen at gmail dot com
@ 2014-11-26 17:13 ` paolo.carlini at oracle dot com
  2015-01-07 19:48 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-26 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-26
     Ever confirmed|0                           |1


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

* [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted
  2014-04-03 23:22 [Bug c++/60753] New: defining an explicit function template specialization as deleted, following a non-deleted declaration, not diagnosted filip.roseen at gmail dot com
  2014-11-26 17:13 ` [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted paolo.carlini at oracle dot com
@ 2015-01-07 19:48 ` paolo.carlini at oracle dot com
  2015-01-08 15:49 ` paolo at gcc dot gnu.org
  2015-01-08 16:10 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-01-07 19:48 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted
  2014-04-03 23:22 [Bug c++/60753] New: defining an explicit function template specialization as deleted, following a non-deleted declaration, not diagnosted filip.roseen at gmail dot com
  2014-11-26 17:13 ` [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted paolo.carlini at oracle dot com
  2015-01-07 19:48 ` paolo.carlini at oracle dot com
@ 2015-01-08 15:49 ` paolo at gcc dot gnu.org
  2015-01-08 16:10 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-01-08 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Thu Jan  8 15:48:36 2015
New Revision: 219347

URL: https://gcc.gnu.org/viewcvs?rev=219347&root=gcc&view=rev
Log:
/cp
2015-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60753
    * decl.c (grokfndecl): Add bool parameter.
    (grokdeclarator): Adjust calls.
    (start_decl): Don't set DECL_DELETED_FN here.

/testsuite
2015-01-08  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/60753
    * g++.dg/cpp0x/deleted10.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/deleted10.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted
  2014-04-03 23:22 [Bug c++/60753] New: defining an explicit function template specialization as deleted, following a non-deleted declaration, not diagnosted filip.roseen at gmail dot com
                   ` (2 preceding siblings ...)
  2015-01-08 15:49 ` paolo at gcc dot gnu.org
@ 2015-01-08 16:10 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-01-08 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org
   Target Milestone|---                         |5.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 5.0.


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

end of thread, other threads:[~2015-01-08 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-03 23:22 [Bug c++/60753] New: defining an explicit function template specialization as deleted, following a non-deleted declaration, not diagnosted filip.roseen at gmail dot com
2014-11-26 17:13 ` [Bug c++/60753] Deleted definition of an explicit function template specialization, following a declaration, incorrectly accepted paolo.carlini at oracle dot com
2015-01-07 19:48 ` paolo.carlini at oracle dot com
2015-01-08 15:49 ` paolo at gcc dot gnu.org
2015-01-08 16:10 ` paolo.carlini at oracle 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).