[llvm-bugs] [Bug 26088] New: Some AST matcher tests fail to compile on Visual Studio 2015.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 8 13:54:08 PST 2016


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

            Bug ID: 26088
           Summary: Some AST matcher tests fail to compile on Visual
                    Studio 2015.
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jujjyl at gmail.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Building trunk LLVM+Clang, in file
tools\clang\unittests\ASTMatchers\ASTMatchersTest.cpp, the following three
tests fail to compile:

TEST(HasDeclaration, HasDeclarationOfTypeWithDecl) {
  EXPECT_TRUE(matches("typedef int X; X a;",
                      varDecl(hasName("a"),
                              hasType(typedefType(hasDeclaration(decl()))))));

  // FIXME: Add tests for other types with getDecl() (e.g. RecordType)
}

which results in http://pastebin.com/iqMexcy1, and

TEST(TypeMatching, MatchesRecordType) {
  EXPECT_TRUE(matches("class C{}; C c;", recordType()));
  EXPECT_TRUE(matches("struct S{}; S s;",
                      recordType(hasDeclaration(recordDecl(hasName("S"))))));
  EXPECT_TRUE(notMatches("int i;",
                        
recordType(hasDeclaration(recordDecl(hasName("S"))))));
}

which results in http://pastebin.com/7S83kTCT, and

TEST(ElaboratedTypeNarrowing, namesType) {
  EXPECT_TRUE(matches(
    "namespace N {"
    "  namespace M {"
    "    class D {};"
    "  }"
    "}"
    "N::M::D d;",
    elaboratedType(elaboratedType(namesType(recordType(
        hasDeclaration(namedDecl(hasName("D")))))))));
  EXPECT_TRUE(notMatches(
    "namespace M {"
    "  class D {};"
    "}"
    "M::D d;",
    elaboratedType(elaboratedType(namesType(typedefType())))));
}

which results in http://pastebin.com/TnSHB6Ep.

-- 
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/20160108/cf753132/attachment.html>


More information about the llvm-bugs mailing list