forked from OSchip/llvm-project
<rdar://problem/13806270> A template argument list is a constant-evaluated context.
llvm-svn: 181076
This commit is contained in:
parent
3880c4cebd
commit
b4eadc34e1
|
@ -1149,6 +1149,9 @@ bool Parser::IsTemplateArgumentList(unsigned Skip) {
|
|||
/// template-argument-list ',' template-argument
|
||||
bool
|
||||
Parser::ParseTemplateArgumentList(TemplateArgList &TemplateArgs) {
|
||||
// Template argument lists are constant-evaluation contexts.
|
||||
EnterExpressionEvaluationContext EvalContext(Actions,Sema::ConstantEvaluated);
|
||||
|
||||
while (true) {
|
||||
ParsedTemplateArgument Arg = ParseTemplateArgument();
|
||||
if (Tok.is(tok::ellipsis)) {
|
||||
|
|
|
@ -337,3 +337,12 @@ namespace rdar13000548 {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
namespace rdar13806270 {
|
||||
template <unsigned N> class X { };
|
||||
const unsigned value = 32;
|
||||
struct Y {
|
||||
X<value + 1> x;
|
||||
};
|
||||
void foo() {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue