[LLVMbugs] [Bug 8783] New: MS __declspec not allowed after enum

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 13 08:58:59 PST 2010


           Summary: MS __declspec not allowed after enum
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: eric at boostpro.com
                CC: llvmbugs at cs.uiuc.edu

The following (somewhat nonsensical) code is accepted by the MS compiler:

  enum __declspec(dllexport) E2 { v0 };

However, in clang, this code generates the following error:

  foo.cpp:12:6: error: expected identifier or '{'
  enum __declspec(dllexport) E2 { v0 };
  foo.cpp:12:1: warning: declaration does not declare anything
  enum __declspec(dllexport) E2 { v0 };
  1 warning and 1 error generated.

It seems clang is not expecting to find __declspec after the enum keyword. Note
that if it's written as:

  __declspec(dllexport) enum E2 { v0 };

it works.

This may not be an issue for __declspec(dllexport), but it will be for the
other __declspecs, like __declspec(deprecated).

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list