Commit 4ef38900 by Paolo Carlini Committed by Paolo Carlini

decl2.c (grokfield): Remove obsolete _vptr check; fix explicit template argument…

decl2.c (grokfield): Remove obsolete _vptr check; fix explicit template argument list error location.

/cp
2018-11-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl2.c (grokfield): Remove obsolete _vptr check; fix
	explicit template argument list error location.

/testsuite
2018-11-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/template/crash91.C: Check location too.

From-SVN: r266264
parent 390e529e
2018-11-18 Paolo Carlini <paolo.carlini@oracle.com>
* decl2.c (grokfield): Remove obsolete _vptr check; fix
explicit template argument list error location.
2018-11-16 Kamlesh Kumar <kamleshbhalui@gmail.com>
DR 1207
......
......@@ -804,7 +804,6 @@ grokfield (const cp_declarator *declarator,
tree value;
const char *asmspec = 0;
int flags;
tree name;
if (init
&& TREE_CODE (init) == TREE_LIST
......@@ -829,21 +828,12 @@ grokfield (const cp_declarator *declarator,
if (value == void_type_node)
return value;
name = DECL_NAME (value);
if (name != NULL_TREE)
if (DECL_NAME (value)
&& TREE_CODE (DECL_NAME (value)) == TEMPLATE_ID_EXPR)
{
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
error ("explicit template argument list not allowed");
return error_mark_node;
}
if (IDENTIFIER_POINTER (name)[0] == '_'
&& id_equal (name, "_vptr"))
error ("member %qD conflicts with virtual function table field name",
value);
error_at (declarator->id_loc,
"explicit template argument list not allowed");
return error_mark_node;
}
/* Stash away type declarations. */
......
2018-11-18 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/template/crash91.C: Check location too.
2018-11-19 Martin Liska <mliska@suse.cz>
PR gcov-profile/88045
......
......@@ -4,5 +4,5 @@ template<int> void foo();
struct A
{
typedef void foo<0>(); // { dg-error "explicit template argument list not allowed" }
typedef void foo<0>(); // { dg-error "16:explicit template argument list not allowed" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment