Bug 45539 - [C++0x] Redeclare a deleted function makes gcc does not issue compile error
Summary: [C++0x] Redeclare a deleted function makes gcc does not issue compile error
Status: RESOLVED DUPLICATE of bug 49066
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-05 06:21 UTC by Ryou Ezoe
Modified: 2011-05-25 12:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryou Ezoe 2010-09-05 06:21:55 UTC
I think re-declare a deleted function is well-formed.

void f() = delete ; // shall be the first declaration of the function
void f() ; // re-declare a previous deleted function.

But doing so makes gcc does not issue correct compile errors on following code.

void f() = delete ;
void f() ; // if I comment out this line. gcc issues correct errors.

int main()
{
    // should be error: use of deleted function 'void f()'
    // gcc does not issue error for this.
    typedef decltype(f) type ;

    // gcc issues error for this.
    // However, error message was: undefined reference to `f()'
    // correct error should be: use of deleted function 'void f()'
    f() ;
}
Comment 1 Jason Merrill 2011-05-25 12:47:39 UTC
Fixed by the patch for 49066.

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