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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to