aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-11-13 23:58:45 -0500
committerJason Merrill <jason@gcc.gnu.org>2016-11-13 23:58:45 -0500
commite7555e42d0143f2a5ee50425902abde7c5091ad3 (patch)
treea84feb431c6724da3b75512ec479a168b52abe58 /gcc/cp/parser.c
parent3ce968519a2b871e3d396dd785359c47218dba1a (diff)
downloadgcc-e7555e42d0143f2a5ee50425902abde7c5091ad3.zip
gcc-e7555e42d0143f2a5ee50425902abde7c5091ad3.tar.gz
gcc-e7555e42d0143f2a5ee50425902abde7c5091ad3.tar.bz2
Improve various diagnostic issues.
* call.c (build_new_method_call_1): Include template arguments in error message. (print_error_for_call_failure): Likewise. (build_new_function_call): Pass them in. * name-lookup.c (supplement_binding_1): Don't complain about a conflict with an erroneous declaration. * error.c (dump_decl): Fix printing of alias declaration. * decl.c (make_typename_type): Call cxx_incomplete_type_error. * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. * semantics.c (perform_koenig_lookup): Don't wrap an error in TEMPLATE_ID_EXPR. From-SVN: r242376
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 1efe4ea..e669c0d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -3272,7 +3272,10 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id,
parser->scope, id, parser->scope);
else if (TYPE_P (parser->scope))
{
- if (cp_lexer_next_token_is (parser->lexer, CPP_LESS))
+ if (!COMPLETE_TYPE_P (parser->scope))
+ cxx_incomplete_type_error (location_of (id), NULL_TREE,
+ parser->scope);
+ else if (cp_lexer_next_token_is (parser->lexer, CPP_LESS))
error_at (location_of (id),
"%qE in %q#T does not name a template type",
id, parser->scope);