aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2008-09-03 00:10:27 -0400
committerJason Merrill <jason@gcc.gnu.org>2008-09-03 00:10:27 -0400
commit4ad610c9785f0022e5ebe686650abaa7ff3c2d5c (patch)
tree593d0e7109cbda785c4e54b5d01f619e24dea375 /gcc/cp/class.c
parenta63068b6dd49f620e85c95f1dfed8f7d7473e17c (diff)
downloadgcc-4ad610c9785f0022e5ebe686650abaa7ff3c2d5c.zip
gcc-4ad610c9785f0022e5ebe686650abaa7ff3c2d5c.tar.gz
gcc-4ad610c9785f0022e5ebe686650abaa7ff3c2d5c.tar.bz2
re PR c++/37208 (C++0x deleted functions and SFINAE)
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. From-SVN: r139926
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 4f69c7e..ab8391b 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6185,6 +6185,10 @@ resolve_address_of_overloaded_function (tree target_type,
function will be marked as used at this point. */
if (!(flags & tf_conv))
{
+ /* Make =delete work with SFINAE. */
+ if (DECL_DELETED_FN (fn) && !(flags & tf_error))
+ return error_mark_node;
+
mark_used (fn);
/* We could not check access when this expression was originally
created since we did not know at that time to which function