diff options
| author | Alexander Kabaev <kan@FreeBSD.org> | 2003-02-10 05:41:50 +0000 |
|---|---|---|
| committer | Alexander Kabaev <kan@FreeBSD.org> | 2003-02-10 05:41:50 +0000 |
| commit | 72983f38e19d795e4671ce8231e076df7f6c5bc0 (patch) | |
| tree | 636a10692c73f4e15c4e3c4effae1b84e967dab9 /contrib/gcc/cp/semantics.c | |
| parent | 3749dff3f9323596a9326efa4bf2b560c0e9d1d3 (diff) | |
| parent | 7b74929d749aa5688fd0814a9880872323e02cde (diff) | |
Notes
Diffstat (limited to 'contrib/gcc/cp/semantics.c')
| -rw-r--r-- | contrib/gcc/cp/semantics.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/contrib/gcc/cp/semantics.c b/contrib/gcc/cp/semantics.c index a4842036d8d3..a6f9afb083f5 100644 --- a/contrib/gcc/cp/semantics.c +++ b/contrib/gcc/cp/semantics.c @@ -2079,20 +2079,28 @@ tree finish_typeof (expr) tree expr; { + tree type; + if (processing_template_decl) { - tree t; + type = make_aggr_type (TYPEOF_TYPE); + TYPE_FIELDS (type) = expr; - t = make_aggr_type (TYPEOF_TYPE); - TYPE_FIELDS (t) = expr; - - return t; + return type; } if (TREE_CODE (expr) == OFFSET_REF) expr = resolve_offset_ref (expr); - return TREE_TYPE (expr); + type = TREE_TYPE (expr); + + if (!type || type == unknown_type_node) + { + error ("type of `%E' is unknown", expr); + return error_mark_node; + } + + return type; } /* Compute the value of the `sizeof' operator. */ |
