Compiling the following code:

extern "C" static void test();

with a 4.5.1 snapshot results in:

test.cpp:1:12: error: invalid use of ‘static’ in linkage specification

The supposedly equivalent

extern "C" {
static void test();
}

works fine.

This used to work before (not sure what version).


Real-world use: This issue breaks building the LZMA SDK 9.12


-- 
           Summary: [4.5 Regression] extern "C" static void test(); produces
                    error
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bero at arklinux dot org
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44717

Reply via email to