Commit 23646391 by Paolo Carlini Committed by Paolo Carlini

re PR c++/22556 (extern array: compatible declaration at function scope refused)

/cp
2014-06-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/22556
	* name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.

/testsuite
2014-06-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/22556
	* g++.dg/other/redecl3.C: New.

From-SVN: r211385
parent 748e88da
2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/22556
* name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
2014-06-07 Jan Hubicka <hubicka@ucw.cz>
* method.c (use_thunk): Use set_decl_section_name.
......
......@@ -974,7 +974,8 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
&& (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl))
/* If different sort of thing, we already gave an error. */
&& TREE_CODE (decl) == TREE_CODE (x)
&& !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))
&& !comptypes (TREE_TYPE (x), TREE_TYPE (decl),
COMPARE_REDECLARATION))
{
if (permerror (input_location, "type mismatch with previous "
"external decl of %q#D", x))
......
2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/22556
* g++.dg/other/redecl3.C: New.
2014-06-09 Marc Glisse <marc.glisse@inria.fr>
PR c++/54442
......
// PR c++/22556
extern int foo[]; // OK
int foo[] = {1,2,3};
extern int foo[]; // OK
void bar(){
extern int foo[]; // g++: ERROR -- SHOULD BE OK
}
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