Bug 37208 - C++0x deleted functions and SFINAE
Summary: C++0x deleted functions and SFINAE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-23 04:58 UTC by dgregor
Modified: 2008-09-17 16:14 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-08-26 16:48:00


Attachments
Test case illustrating the problem (221 bytes, text/plain)
2008-08-23 04:59 UTC, dgregor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dgregor 2008-08-23 04:58:35 UTC
Deleted functions don't cause SFINAE failures (or any kind of failure), but they should.
Comment 1 dgregor 2008-08-23 04:59:42 UTC
Created attachment 16133 [details]
Test case illustrating the problem
Comment 2 Paolo Carlini 2008-08-23 09:31:00 UTC
Let's CC Jason...
Comment 3 Jason Merrill 2008-09-03 04:11:50 UTC
Subject: Bug 37208

Author: jason
Date: Wed Sep  3 04:10:27 2008
New Revision: 139926

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139926
Log:
        PR c++/37208
        * call.c (build_over_call): Make =delete work with SFINAE.
        * class.c (resolve_address_of_overloaded_function): Likewise.

        * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to
        threadprivate_or_deleted_p.
        (CP_DECL_THREADPRIVATE_P): Adjust.
        (DECL_DELETED_FN): Likewise.
        (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros.
        (SD_DELETED): New macro.
        * parser.c (cp_parser_init_declarator): Use them.
        * decl.c (start_decl): Use them.

        * decl2.c (mark_used): Give =deleted error even in sizeof.

        * typeck2.c (check_narrowing): Downgrade narrowing error to
        permerror.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted4.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/typeck2.c

Comment 4 Jason Merrill 2008-09-17 16:14:00 UTC
Fixed.