[llvm-bugs] [Bug 46287] New: cxxConstructExpr stopped matching templates

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 11 09:49:08 PDT 2020


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: unassignedclangbugs at nondot.org
          Reporter: lukasza at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

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


More information about the llvm-bugs mailing list