[llvm-bugs] [Bug 46416] New: Clang accepts empty declaration in a class declaration

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 21 19:04:30 PDT 2020


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

            Bug ID: 46416
           Summary: Clang accepts empty declaration in a class declaration
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

This code bug.cc, Clang accepts it, while gcc, icc, or msvc rejects it.

$cat bug.cc
class A {
    int ;
    long ;
    char ;
};

For example in gcc,

$g++ -c bug.cc
bug.cc:2:5: error: declaration does not declare anything [-fpermissive]
     int ;
     ^
bug.cc:3:5: error: declaration does not declare anything [-fpermissive]
     long ;
     ^
bug.cc:4:5: error: declaration does not declare anything [-fpermissive]
     char ;

My clang version is

$clang++ --version
clang version 11.0.0 (https://github.com/llvm/llvm-project
e6aba43cda848f4a8cfa5ce9f174b77def10e9df)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/compilers/llvm-clang/llvm-project/build/bin

-- 
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/20200622/1c8da046/attachment-0001.html>


More information about the llvm-bugs mailing list