From: Roger Sayle Date: Tue, 7 Feb 2006 03:40:19 +0000 (+0000) Subject: decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b38a05d08306bd2a0b81e1a59e0d7b3d66ddaca2;p=gcc.git decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE. * decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE. * rtti.c (typeinfo_in_lib_p): Likewise. * cp-tree.h (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P): Likewise. * name-lookup.c (arg_assoc_type): Likewise. From-SVN: r110687 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e1737e90e89..18da1285724 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2006-02-06 Roger Sayle + + * decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE. + * rtti.c (typeinfo_in_lib_p): Likewise. + * cp-tree.h (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P): Likewise. + * name-lookup.c (arg_assoc_type): Likewise. + 2006-02-04 Gabriel Dos Reis * cp-tree.h (tf_warn_or_error): New substituion flag. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index c74ad9db8fe..1ae93e9b036 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1,6 +1,6 @@ /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -2358,12 +2358,12 @@ extern void decl_shadowed_for_var_insert (tree, tree); #define DECL_EXTERNAL_LINKAGE_P(DECL) \ (decl_linkage (DECL) == lk_external) -/* Keep these codes in ascending code order. CHAR_TYPE is used here - to completely fill the range. */ +/* Keep these codes in ascending code order. */ -#define INTEGRAL_CODE_P(CODE) \ - ((CODE) == ENUMERAL_TYPE || (CODE) == BOOLEAN_TYPE \ - || (CODE) == CHAR_TYPE || (CODE) == INTEGER_TYPE) +#define INTEGRAL_CODE_P(CODE) \ + ((CODE) == ENUMERAL_TYPE \ + || (CODE) == BOOLEAN_TYPE \ + || (CODE) == INTEGER_TYPE) /* [basic.fundamental] @@ -2372,11 +2372,9 @@ extern void decl_shadowed_for_var_insert (tree, tree); Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration types as well, which is incorrect in C++. Keep these checks in - ascending code order. CHAR_TYPE is added to complete the interval of - values. */ + ascending code order. */ #define CP_INTEGRAL_TYPE_P(TYPE) \ (TREE_CODE (TYPE) == BOOLEAN_TYPE \ - || TREE_CODE (TYPE) == CHAR_TYPE \ || TREE_CODE (TYPE) == INTEGER_TYPE) /* Returns true if TYPE is an integral or enumeration name. Keep diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 5aab8b1ab9d..f9b24264d4b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1,6 +1,6 @@ /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -7035,8 +7035,7 @@ grokdeclarator (const cp_declarator *declarator, `signed int' cannot be so controlled. */ && !(typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl)) - && (TREE_CODE (type) == INTEGER_TYPE - || TREE_CODE (type) == CHAR_TYPE) + && TREE_CODE (type) == INTEGER_TYPE && !same_type_p (TYPE_MAIN_VARIANT (type), wchar_type_node))) { if (longlong) diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b464e328b47..449b8c625ac 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1,5 +1,5 @@ /* Definitions for C++ name lookup routines. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. @@ -4445,7 +4445,6 @@ arg_assoc_type (struct arg_lookup *k, tree type) case REAL_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: - case CHAR_TYPE: case BOOLEAN_TYPE: return false; case RECORD_TYPE: diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 54d82c7165e..7b1a667c214 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -1,6 +1,6 @@ /* RunTime Type Identification Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 + 2005, 2006 Free Software Foundation, Inc. Mostly written by Jason Merrill (jason@cygnus.com). @@ -986,7 +986,6 @@ typeinfo_in_lib_p (tree type) { case INTEGER_TYPE: case BOOLEAN_TYPE: - case CHAR_TYPE: case REAL_TYPE: case VOID_TYPE: return true;