Acccording to C++ standard 7.5/7 "A linkage-specification directly containing a single declaration shall not specify a storage class." They also give the following example as invalid: extern "C" static void foo(); But g++ version 4.0.2 accepts this.
Confirmed, a regression from 3.0.4: t.cc:1: multiple storage classes in declaration of `foo'
This issue will not be resolved in GCC 4.1.0; retargeted at GCC 4.1.1.
Subject: Bug 26068 Author: mmitchel Date: Wed May 17 17:24:00 2006 New Revision: 113869 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113869 Log: PR c++/26068 * parser.c (cp_parser_set_storage_class): Check for invalid uses of storage classes on unbraced linkage specifications. (cp_parser_decl_specifier_seq): Pass keywords, not storage classes, to cp_parser_set_storage_class. PR c++/26068 * g++.dg/opt/pr17697-3.C: Remove invalid extern specifier. * g++.dg/parse/linkage1.C: New test. Added: trunk/gcc/testsuite/g++.dg/parse/linkage1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/opt/pr17697-3.C
Fixed in 4.2.
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Subject: Bug 26068 Author: mmitchel Date: Wed May 31 02:55:52 2006 New Revision: 114261 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114261 Log: PR c++/26068 * parser.c (cp_parser_set_storage_class): Check for invalid uses of storage classes on unbraced linkage specifications. (cp_parser_decl_specifier_seq): Pass keywords, not storage classes, to cp_parser_set_storage_class. PR c++/26068 * g++.dg/opt/pr17697-3.C: Remove invalid extern specifier. * g++.dg/parse/linkage1.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/linkage1.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/parser.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/pr17697-3.C
Fixed in 4.1.2.
Won't be fixed o the 4.0 branch. Fixed in GCC 4.1.2.
*** Bug 33078 has been marked as a duplicate of this bug. ***
*** Bug 44717 has been marked as a duplicate of this bug. ***