diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-02-23 12:40:59 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-02-23 12:40:59 +0000 |
commit | 29f4ceab97334d8e361a103dae4254766414acf5 (patch) | |
tree | e2ff312db4984c06efeaee8266b65897019e9807 /gcc | |
parent | 6871ba5ffcd7c2eccc4acd66da2ab4f9bdb730fe (diff) | |
download | gcc-29f4ceab97334d8e361a103dae4254766414acf5.zip gcc-29f4ceab97334d8e361a103dae4254766414acf5.tar.gz gcc-29f4ceab97334d8e361a103dae4254766414acf5.tar.bz2 |
re PR c++/14250 (switch() does not seem to see operator int() in template class)
PR c++/14250
* cvt.c (build_expr_type_conversion): Type must be complete before
looking up for conversions.
From-SVN: r78293
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index be8d705..f9a710d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org> + PR c++/14250 + * cvt.c (build_expr_type_conversion): Type must be complete before + looking up for conversions. + +2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org> + PR c++/14143 * name-lookup.c (arg_assoc_class): Don't look into template arguments if it is not a primary template. diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 097daf9..ada5888 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1034,8 +1034,9 @@ build_expr_type_conversion (int desires, tree expr, bool complain) /* The code for conversions from class type is currently only used for delete expressions. Other expressions are handled by build_new_op. */ - - if (! TYPE_HAS_CONVERSION (basetype)) + if (!complete_type_or_else (basetype, expr)) + return error_mark_node; + if (!TYPE_HAS_CONVERSION (basetype)) return NULL_TREE; for (conv = lookup_conversions (basetype); conv; conv = TREE_CHAIN (conv)) |