[llvm-bugs] [Bug 46288] New: Missing warning "extra '; ' outside of a function" in -Wpedantic

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 11 10:05:20 PDT 2020


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

            Bug ID: 46288
           Summary: Missing warning "extra ';' outside of a function" in
                    -Wpedantic
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            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 simple code bug.cc

void foo(){};

In clang-trunk, it produce nothing with "clang++ -c -Wpedantic bug.cc".

While in clang-5 or lower versions,

$clang++-5 -c -Wpedantic bug.cc
bug.cc:1:13: warning: extra ';' outside of a function is a C++11 extension
[-Wc++11-extra-semi]
void foo(){};
            ^
1 warning generated.

Also in gcc-trunk

$g++ -c -Wpedantic bug.cc
bug.cc:1:13: warning: extra ‘;’ [-Wpedantic]
 void foo(){};

According to https://clang.llvm.org/docs/DiagnosticsReference.html#wpedantic,
I think clang should give a -Wpedantic warning but it doesn't.

My clang-trunk 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/.

Also reproduced in godbolt : https://godbolt.org/z/-JZaSO

-- 
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/20200611/afd257c8/attachment.html>


More information about the llvm-bugs mailing list