зеркало из https://github.com/microsoft/clang-1.git
PR3330: given an enum like this:
enum E { A = 1U, B }; Don't make an implicit cast expr of null for B. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62274 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
72b1b15ee8
Коммит
13fd416b3d
|
@ -3684,8 +3684,9 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDeclX,
|
|||
ECD->setInitVal(InitVal);
|
||||
|
||||
// Adjust the Expr initializer and type.
|
||||
ECD->setInitExpr(new ImplicitCastExpr(NewTy, ECD->getInitExpr(),
|
||||
/*isLvalue=*/false));
|
||||
if (ECD->getInitExpr())
|
||||
ECD->setInitExpr(new ImplicitCastExpr(NewTy, ECD->getInitExpr(),
|
||||
/*isLvalue=*/false));
|
||||
if (getLangOptions().CPlusPlus)
|
||||
// C++ [dcl.enum]p4: Following the closing brace of an
|
||||
// enum-specifier, each enumerator has the type of its
|
||||
|
|
Загрузка…
Ссылка в новой задаче