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

            Bug ID: 46287
           Summary: cxxConstructExpr stopped matching templates
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

CLANG VERSION:

    $ third_party/llvm-build/Release+Asserts/bin/clang++ --version
    clang version 11.0.0 (https://github.com/llvm/llvm-project/
f7f1abdb8893af4a606ca1a8f5347a426e9c7f9e)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir:
/usr/local/google/home/lukasza/src/chromium4/src/third_party/llvm-build/Release+Asserts/bin


REPRO INPUT FILE:

    template <typename T>
    struct MyTemplate {
      MyTemplate(int i) {}
    };

    void foo() {
      MyTemplate<char> mt(123);  // <- corresponds to the CXXConstructExpr node
below
    }


REPRO INPUT FILE RENDERED AS AST:

    $ third_party/llvm-build/Release+Asserts/bin/clang++ -Xclang -ast-dump
-std=c++14 tools/clang/rewrite_raw_ptr_fields/tests/affected-expr-original.cc
    ...
    `-FunctionDecl 0x5b38300 <line:6:1, line:8:1> line:6:6 foo 'void ()'
      `-CompoundStmt 0x5b65318 <col:12, line:8:1>
        `-DeclStmt 0x5b65300 <line:7:3, col:27>
          `-VarDecl 0x5b385b8 <col:3, col:26> col:20 mt
'MyTemplate<char>':'MyTemplate<char>' callinit
            `-CXXConstructExpr 0x5b652d0 <col:20, col:26>
'MyTemplate<char>':'MyTemplate<char>' 'void (int)'
              `-IntegerLiteral 0x5b38620 <col:23> 'int' 123


REPRO MATCHER:

    cxxConstructExpr().bind("ctor")


EXPECTED BEHAVIOR: The cxxConstructExpr matcher matches all CXXConstructExpr
nodes from the AST

ACTUAL BEHAVIOR: The CXXConstructExpr above is not matched.

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

Reply via email to