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

            Bug ID: 35952
           Summary: CXXNewExpr returns invalid end loc for valid code "new
                    struct Foo;"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: hok...@google.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

Reproduce code:

```
void NewExprCheck::registerMatchers(MatchFinder *Finder) {
  Finder->addMatcher(cxxNewExpr().bind("x"), this);
}

void NewExprCheck::check(const MatchFinder::MatchResult &Result) {
  const auto *E = Result.Nodes.getNodeAs<CXXNewExpr>("x");
  E->getEndLoc().dump(Result.Context->getSourceManager());
}
```


For the following test code:

```
struct Foo {}

void f() {
  new struct Foo; // invalid end loc
  new Foo; // valid end loc
}
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to