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

            Bug ID: 39867
           Summary: Single line of C++ "template <>;" gives no errors, but
                    does with other compilers
           Product: new-bugs
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

clang reports no syntax errors for this single line .cxx file:

--------------------------
 template <>;
--------------------------

leprechaun:~ sean$ clang --version
clang version 8.0.0 (trunk 347180)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Users/sean/llvm/llvm-rel-install/bin

leprechaun:~ sean$ clang -fsyntax-only ~/Desktop/test.cxx 
/Users/sean/Desktop/test.cxx:1:13: warning: declaration does not declare
anything [-Wmissing-declarations]
 template <>;
            ^
1 warning generated.

cppcheck 1.85, gcc 7.3.0, and VisualStudio 2017 give an error.

I arrived at this silly file by using creduce to make a reduced test case for
valid code that cppcheck was rejecting.  So my 'interestingness test' was:
something that cppcheck reported an error for, but clang did not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to