Implement DR 757...
authorJason Merrill <jason@redhat.com>
Mon, 10 Aug 2009 20:47:55 +0000 (16:47 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 10 Aug 2009 20:47:55 +0000 (16:47 -0400)
commite8f43da6f9d34f17f3e6e4adbf42e79addb5e217
treea4546f632af854bec30da3734e864ea5f11269f0
parent8d1b99e26ad5c88a05c7c7ba2fbb05bdc345e9d2
Implement DR 757...

Implement DR 757: It's OK for a decl to use a type without linkage
so long as the decl is defined in the current translation unit.
* decl2.c (no_linkage_decls): New vector.
(mark_used): Add decls that use types with no linkage.
(cp_write_global_declarations): Check that they are defined.
(decl_defined_p, no_linkage_error): New fns.
* cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
(struct lang_decl_base): Add flag.
* decl.c (grokfndecl): Don't check type linkage.
(grokvardecl): If the type has no linkage, just make sure
DECL_LANG_SPECIFIC is set.
* pt.c (check_instantiated_arg): Don't check type linkage.
* name-lookup.c (is_local_extern): New fn.
* name-lookup.h: Declare it.

From-SVN: r150634
19 files changed:
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/anon-struct4.C
gcc/testsuite/g++.dg/lookup/anon2.C
gcc/testsuite/g++.dg/other/anon3.C
gcc/testsuite/g++.dg/other/linkage2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/arg2.C
gcc/testsuite/g++.dg/template/local4.C
gcc/testsuite/g++.old-deja/g++.law/operators32.C
gcc/testsuite/g++.old-deja/g++.other/anon9.C
gcc/testsuite/g++.old-deja/g++.other/linkage1.C
gcc/testsuite/g++.old-deja/g++.other/linkage2.C
gcc/testsuite/g++.old-deja/g++.pt/enum6.C