potentially-evaluated context.
This applies even if the use of the default argument is within an
unevaluated context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363113
91177308-0d34-0410-b5e6-
96231b3b80d8
// We already type-checked the argument, so we know it works.
// Just mark all of the declarations in this potentially-evaluated expression
// as being "referenced".
+ EnterExpressionEvaluationContext EvalContext(
+ *this, ExpressionEvaluationContext::PotentiallyEvaluated, Param);
MarkDeclarationsReferencedInExpr(Param->getDefaultArg(),
/*SkipLocalVariables=*/true);
return false;
X<int> *p;
}
}
+
+namespace unevaluated {
+ int a;
+ template<int = 0> int f(int = a); // expected-warning 0-1{{extension}}
+ int k = sizeof(f());
+}