mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/35321 (ICE with invalid use of __builtin_offsetof)
2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/35321 * c-common.c (fold_offsetof_1): Handle TARGET_EXPR like CALL_EXPR. /testsuite 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/35321 * g++.dg/parse/offsetof8.C: New. From-SVN: r139628
This commit is contained in:
parent
a822144001
commit
8d5f60ac74
|
|
@ -1,3 +1,8 @@
|
||||||
|
2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
|
PR c++/35321
|
||||||
|
* c-common.c (fold_offsetof_1): Handle TARGET_EXPR like CALL_EXPR.
|
||||||
|
|
||||||
2008-08-27 Paul Brook <paul@codesourcery.com>
|
2008-08-27 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
* config.gcc: Loosen checks for arm uclinux eabi targets.
|
* config.gcc: Loosen checks for arm uclinux eabi targets.
|
||||||
|
|
|
||||||
|
|
@ -7685,6 +7685,7 @@ fold_offsetof_1 (tree expr, tree stop_ref)
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
case CALL_EXPR:
|
case CALL_EXPR:
|
||||||
|
case TARGET_EXPR:
|
||||||
error ("cannot apply %<offsetof%> when %<operator[]%> is overloaded");
|
error ("cannot apply %<offsetof%> when %<operator[]%> is overloaded");
|
||||||
return error_mark_node;
|
return error_mark_node;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
|
PR c++/35321
|
||||||
|
* g++.dg/parse/offsetof8.C: New.
|
||||||
|
|
||||||
2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
||||||
|
|
||||||
PR c++/17880
|
PR c++/17880
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
// PR c++/35321
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
A operator[] (int);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
A a;
|
||||||
|
};
|
||||||
|
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
__builtin_offsetof(B, a[0]); /* { dg-error "error: cannot apply 'offsetof' when 'operator\\\[\\\]' is overloaded" } */
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue