[llvm-bugs] [Bug 26648] New: "inline" shouldn't be recognized as a C keyword in MSVC 2013 compatibility mode

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 17 02:33:46 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26648

            Bug ID: 26648
           Summary: "inline" shouldn't be recognized as a C keyword in
                    MSVC 2013 compatibility mode
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andreybokhanko at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

There is a subtle, yet important (at least, many of our internal tests are
affected) MSVC compatibility bug.

MSVC 2013 compiler doesn't recognize "inline" as a keyword in *.c programs:

$ cat H:/test.c
int inline = 0;

$ type cl
cl is c:/Program files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.EXE

$ cl -c H:/test.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

test.c


MSVC 2015 does recognize "inline" as a keyword and disallow its usage as an
identifier:

$ type cl
cl is c:/Program files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64/cl.EXE

$ cl -c H:/test.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

test.c
H:/test.c(1): error C2513: 'int': no variable declared before '='


clang-cl always recognizes "inline" as a keyword, in both MSVC2013 and MSVC2015
modes.

Yours,
Andrey
======
Software Engineer
Intel Compiler Team

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160217/8d043eb5/attachment.html>


More information about the llvm-bugs mailing list