mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-02 16:23:56 +08:00
c-decl.c (grokdeclarator): Use INTEGRAL_TYPE_P.
* c-decl.c (grokdeclarator): Use INTEGRAL_TYPE_P. * c-typeck.c (c_start_case): Likewise. testsuite: * gcc.c-torture/compile/20010610-1.c: New test. From-SVN: r43257
This commit is contained in:
parent
0ea834c115
commit
2c1a24210c
@ -1,3 +1,9 @@
|
||||
2001-06-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* c-decl.c (grokdeclarator): Use INTEGRAL_TYPE_P.
|
||||
|
||||
* c-typeck.c (c_start_case): Likewise.
|
||||
|
||||
2001-06-12 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* expr.c (store_field): Don't set MEM_ALIAS_SET for a field
|
||||
|
@ -4357,8 +4357,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
||||
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
|
||||
STRIP_TYPE_NOPS (size);
|
||||
|
||||
if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE
|
||||
&& TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE)
|
||||
if (! INTEGRAL_TYPE_P (TREE_TYPE (size)))
|
||||
{
|
||||
error ("size of array `%s' has non-integer type", name);
|
||||
size = integer_one_node;
|
||||
|
@ -7077,8 +7077,7 @@ c_start_case (exp)
|
||||
code = TREE_CODE (TREE_TYPE (exp));
|
||||
type = TREE_TYPE (exp);
|
||||
|
||||
if (code != INTEGER_TYPE
|
||||
&& code != ENUMERAL_TYPE
|
||||
if (! INTEGRAL_TYPE_P (type)
|
||||
&& code != ERROR_MARK)
|
||||
{
|
||||
error ("switch quantity not an integer");
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-06-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* gcc.c-torture/compile/20010610-1.c: New test.
|
||||
|
||||
2001-06-12 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* g++.old-deja/g++.abi/vbase4.C: New test.
|
||||
|
19
gcc/testsuite/gcc.c-torture/compile/20010610-1.c
Normal file
19
gcc/testsuite/gcc.c-torture/compile/20010610-1.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
Boolean types were not accepted as array sizes nor as switch
|
||||
quantities. */
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
bool arr[(bool)1];
|
||||
|
||||
switch (arr[0])
|
||||
{
|
||||
default:;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user