aaron.ballman added inline comments.
================ Comment at: lib/Sema/SemaChecking.cpp:8185 + if (!C.getLangOpts().CPlusPlus) { + // For enum types, for C code, use underlying data type. + if (const EnumType *ET = dyn_cast<EnumType>(T)) ---------------- For enum types in C code, use the underlying datatype. ================ Comment at: lib/Sema/SemaChecking.cpp:8186 + // For enum types, for C code, use underlying data type. + if (const EnumType *ET = dyn_cast<EnumType>(T)) + T = ET->getDecl()->getIntegerType().getDesugaredType(C).getTypePtr(); ---------------- Can use `const auto *` here. ================ Comment at: lib/Sema/SemaChecking.cpp:8188 + T = ET->getDecl()->getIntegerType().getDesugaredType(C).getTypePtr(); + } else if (const EnumType *ET = dyn_cast<EnumType>(T)) { + // For enum types, in C++, use the known bit width of the enumerators. ---------------- Here as well. ================ Comment at: lib/Sema/SemaChecking.cpp:8189 + } else if (const EnumType *ET = dyn_cast<EnumType>(T)) { + // For enum types, in C++, use the known bit width of the enumerators. EnumDecl *Enum = ET->getDecl(); ---------------- For enum types in C++, ================ Comment at: lib/Sema/SemaChecking.cpp:8593 + Min, // e.g. -32768 for short + Both // e.g. in C++, A::a in enum A { a = 0 }; }; ---------------- `Both` is not very descriptive -- I think `Zero` might be an improvement. Repository: rL LLVM https://reviews.llvm.org/D39122 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits