Pass the location of the type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41612 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseExpr.cpp b/Parse/ParseExpr.cpp
index ff2af56..cade7a6 100644
--- a/Parse/ParseExpr.cpp
+++ b/Parse/ParseExpr.cpp
@@ -776,6 +776,7 @@
break;
case tok::kw___builtin_offsetof: {
+ SourceLocation TypeLoc = Tok.getLocation();
TypeTy *Ty = ParseTypeName();
if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "",tok::r_paren))
@@ -826,7 +827,7 @@
Comps.back().LocEnd =
MatchRHSPunctuation(tok::r_square, Comps.back().LocStart);
} else if (Tok.getKind() == tok::r_paren) {
- Res = Actions.ParseBuiltinOffsetOf(StartLoc, Ty, &Comps[0],
+ Res = Actions.ParseBuiltinOffsetOf(StartLoc, TypeLoc, Ty, &Comps[0],
Comps.size(), ConsumeParen());
break;
} else {
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 1f84e0d..cb1acf5 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -387,7 +387,7 @@
};
virtual ExprResult ParseBuiltinOffsetOf(SourceLocation BuiltinLoc,
- TypeTy *Arg1,
+ SourceLocation TypeLoc, TypeTy *Arg1,
OffsetOfComponent *CompPtr,
unsigned NumComponents,
SourceLocation RParenLoc) {