Function declarations are, in fact, permitted in the init-statement of a for

loop. Don't confuse Sema by saying they're not.

llvm-svn: 274080
This commit is contained in:
Richard Smith 2016-06-28 23:26:18 +00:00
parent 42398051d8
commit 3ffc45f5fd
2 changed files with 5 additions and 1 deletions

View File

@ -2119,9 +2119,9 @@ public:
case FileContext:
case MemberContext:
case BlockContext:
case ForContext:
return true;
case ForContext:
case ConditionContext:
case KNRTypeListContext:
case TypeNameContext:

View File

@ -502,3 +502,7 @@ namespace PR24989 {
using T = decltype(x);
void (T::*p)(int) const = &T::operator();
}
void forinit_decltypeauto() {
for (decltype(auto) forinit_decltypeauto_inner();;) {} // expected-warning {{interpreted as a function}} expected-note {{replace}}
}