return a location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44889
91177308-0d34-0410-b5e6-
96231b3b80d8
const UnaryOperator *Exp = cast<UnaryOperator>(this);
// C99 6.6p9
- if (Exp->getOpcode() == UnaryOperator::AddrOf)
- return Exp->getSubExpr()->hasStaticStorage();
+ if (Exp->getOpcode() == UnaryOperator::AddrOf) {
+ if (!Exp->getSubExpr()->hasStaticStorage()) {
+ if (Loc) *Loc = getLocStart();
+ return false;
+ }
+ return true;
+ }
// Get the operand value. If this is sizeof/alignof, do not evalute the
// operand. This affects C99 6.6p3.