diff options
| author | Mark Mitchell <mark@codesourcery.com> | 2005-10-02 21:28:50 +0000 |
|---|---|---|
| committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-10-02 21:28:50 +0000 |
| commit | c0ad5a317379afbc3dfb0fb1fd4e6fdb98aab8e2 (patch) | |
| tree | 10dca596efc248e2d42da67bbf26853432593ca3 /gcc/cp/tree.c | |
| parent | b19bb8b0445fca3bef3d30d244395c2319c1bf9c (diff) | |
| download | gcc-c0ad5a317379afbc3dfb0fb1fd4e6fdb98aab8e2.zip gcc-c0ad5a317379afbc3dfb0fb1fd4e6fdb98aab8e2.tar.gz gcc-c0ad5a317379afbc3dfb0fb1fd4e6fdb98aab8e2.tar.bz2 | |
re PR c++/23840 (Bogus "invalid lvalue in unary '&'" diagnostic and ICE with va_arg)
PR c++/23840
* tree.c (lvalue_p1): A VA_ARG_EXPR with class type is an lvalue,
when class rvalues are lvalues.
PR c++/23840
* g++.dg/expr/stdarg1.C: New test.
From-SVN: r104877
Diffstat (limited to 'gcc/cp/tree.c')
| -rw-r--r-- | gcc/cp/tree.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 9c28f13..954a809 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -158,8 +158,12 @@ lvalue_p_1 (tree ref, case TARGET_EXPR: return treat_class_rvalues_as_lvalues ? clk_class : clk_none; - case CALL_EXPR: case VA_ARG_EXPR: + return (treat_class_rvalues_as_lvalues + && CLASS_TYPE_P (TREE_TYPE (ref)) + ? clk_class : clk_none); + + case CALL_EXPR: /* Any class-valued call would be wrapped in a TARGET_EXPR. */ return clk_none; |
