Commit ba167748 by Jan Hubicka Committed by Jan Hubicka

re PR ipa/87957 (ICE tree check: expected tree that contains ‘decl minimal’…

re PR ipa/87957 (ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519)

	PR ipa/87957
	* ipa-devirt.c (warn_odr): Look for main variant to get TYPE_DECL.

From-SVN: r266235
parent d7815fc4
2018-11-16 Jan Hubicka <hubicka@ucw.cz>
PR ipa/87957
* ipa-devirt.c (warn_odr): Look for main variant to get TYPE_DECL.
2018-11-16 Sandra Loosemore <sandra@codesourcery.com>
* doc/invoke.texi (Option Summary): Fix whitespace and line
......@@ -1000,11 +1000,11 @@ static void
warn_odr (tree t1, tree t2, tree st1, tree st2,
bool warn, bool *warned, const char *reason)
{
tree decl2 = TYPE_NAME (t2);
tree decl2 = TYPE_NAME (TYPE_MAIN_VARIANT (t2));
if (warned)
*warned = false;
if (!warn || !TYPE_NAME(t1))
if (!warn || !TYPE_NAME(TYPE_MAIN_VARIANT (t1)))
return;
/* ODR warnings are output druing LTO streaming; we must apply location
......@@ -1013,10 +1013,22 @@ warn_odr (tree t1, tree t2, tree st1, tree st2,
lto_location_cache::current_cache->apply_location_cache ();
auto_diagnostic_group d;
if (!warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (t1)), OPT_Wodr,
"type %qT violates the C++ One Definition Rule",
t1))
return;
if (t1 != TYPE_MAIN_VARIANT (t1)
&& TYPE_NAME (t1) != DECL_NAME (TYPE_MAIN_VARIANT (t1)))
{
if (!warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (TYPE_MAIN_VARIANT (t1))),
OPT_Wodr, "type %qT (typedef of %qT) violates the "
"C++ One Definition Rule",
t1, TYPE_MAIN_VARIANT (t1)))
return;
}
else
{
if (!warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (TYPE_MAIN_VARIANT (t1))),
OPT_Wodr, "type %qT violates the C++ One Definition Rule",
t1))
return;
}
if (!st1 && !st2)
;
/* For FIELD_DECL support also case where one of fields is
......
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