зеркало из https://github.com/microsoft/clang-1.git
fix one more this-is-not-a-constant error. test included
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55609 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
f7e37ce840
Коммит
73419bf6cb
|
@ -1269,6 +1269,9 @@ bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) {
|
|||
if (Init->getType()->isArrayType())
|
||||
return false;
|
||||
|
||||
if (Init->getType()->isFunctionType())
|
||||
return false;
|
||||
|
||||
Diag(Init->getExprLoc(), diag::err_init_element_not_constant,
|
||||
Init->getSourceRange());
|
||||
return true;
|
||||
|
|
|
@ -235,3 +235,6 @@ struct soft_segment_descriptor gdt_segs[] = {
|
|||
{(int) &dblfault_tss},
|
||||
{ (int)xpto},
|
||||
};
|
||||
|
||||
static void sppp_ipv6cp_up();
|
||||
const struct {} ipcp = { sppp_ipv6cp_up }; //expected-warning{{empty struct extension}} expected-warning{{excess elements in array initializer}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче