[llvm-bugs] [Bug 49559] New: LibclangTest.cpp has an un-executed EXPECT_FALSE test

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 12 07:46:08 PST 2021


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

            Bug ID: 49559
           Summary: LibclangTest.cpp has an un-executed EXPECT_FALSE test
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

clang/unittests/libclang/LibclangTest.cpp has a test 
"clang_hasVarDeclGlobalStorageFalse" containing a lambda with this code:

        if (clang_getCursorKind(cursor) == CXCursor_VarDecl) {
          EXPECT_FALSE(clang_Cursor_hasVarDeclGlobalStorage(cursor));
          return CXChildVisit_Break;
        }
        return CXChildVisit_Continue;

However, the cursor kind is never CXCursor_VarDecl, and the EXPECT_FALSE
is never executed.  (Replacing with assert or llvm_unreachable does not fire.)


Found by the Rotten Green Tests project.

-- 
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/20210312/908549c0/attachment.html>


More information about the llvm-bugs mailing list