Title
Are deleted and defaulted functions definitions?
Status
c++11
Section
6.2 [basic.def]
Submitter
Daniel Kr├╝gler

Created on 2010-09-20.00:00:00 last changed 96 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting.]

Date: 2011-01-15.00:00:00

Proposed resolution (January, 2011):

Change the grammar in 9.5.1 [dcl.fct.def.general] paragraph 1 as follows:

    function-definition:
      attribute-specifier-seqopt decl-specifier-seqopt declarator function-body
      attribute-specifier-seqopt decl-specifier-seqopt declarator = default ;
      attribute-specifier-seqopt decl-specifier-seqopt declarator = delete ;
    function-body:
      ctor-initializeropt compound-statement
      function-try-block
      = default ;
      = delete ;
Date: 2010-09-20.00:00:00

According to 6.3 [basic.def.odr] paragraph 2,

A declaration is a definition unless it declares a function without specifying the function's body (9.5 [dcl.fct.def]), it contains the extern specifier (9.2.2 [dcl.stc]) or a linkage-specification25 (9.11 [dcl.link]) and neither an initializer nor a function-body...

Because = delete and = default are not forms of function-body, this description does not cover defaulted and deleted functions, even though these declarations are elsewhere referred to as being definitions.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3288
2011-04-10 00:00:00adminsetstatus: tentatively ready -> fdis
2011-02-28 00:00:00adminsetstatus: review -> tentatively ready
2010-11-29 00:00:00adminsetmessages: + msg3067
2010-11-29 00:00:00adminsetstatus: open -> review
2010-09-20 00:00:00admincreate