This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41476] New: [4.5 regression] __typeof__ expands to const type
- From: "schwab at linux-m68k dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Sep 2009 17:09:09 -0000
- Subject: [Bug c/41476] New: [4.5 regression] __typeof__ expands to const type
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When __typeof__ is applied to a conditional expression that contains a call to
a const function it expands to a const type.
$ cat tgmath.c
int foo (int) __attribute__ ((const));
void
test (void)
{
__typeof__ (1 ? foo (0) : 0) texpr;
texpr = 0;
}
$ gcc -c tgmath.c
tgmath.c: In function ‘test’:
tgmath.c:7:3: error: assignment of read-only variable ‘texpr’
--
Summary: [4.5 regression] __typeof__ expands to const type
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schwab at linux-m68k dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41476