[llvm-bugs] [Bug 39867] New: Single line of C++ "template <>; " gives no errors, but does with other compilers

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 3 07:35:53 PST 2018


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: unassignedbugs at nondot.org
          Reporter: sean at rogue-research.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181203/bdcf7022/attachment.html>


More information about the llvm-bugs mailing list