This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Testcase for bug 17844


Bug 17844 turned out to be already fixed on mainline, but I've committed 
the following testcase as gcc.dg/pr17844-1.c (and closed the bug).

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2004-10-09  Joseph S. Myers  <jsm@polyomino.org.uk>

        PR c/17844
        * gcc.dg/pr17844-1.c: New test.

/* -fshort-enums should affect only the type with which an enum is
    compatible, not the type of the enumeration constants which should
    still be int.  Bug 17844.  */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-fshort-enums" } */

enum e { A, B };

enum e ev;
unsigned char uv;
enum e *ep = &uv;
unsigned char *up = &ev;

int i;
__typeof__(A) te;
int *ip = &te;
__typeof__(B) *tep = &i;

int x[((sizeof(A) == sizeof(int)) ? 1 : -1)];


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]