[Clang] Avoid crashes when parsing using enum declarations
In Parser::ParseUsingDeclaration(...) when we call ParseEnumSpecifier(...) it is not calling SetTypeSpecError() on DS when it detects an error. That means that DS is left set to TST_unspecified. When we then pass DS into Sema::ActOnUsingEnumDeclaration(...) we hit an llvm_unreachable(...) since it expects it to be one of three states TST_error, TST_enum or TST_typename. This fixes https://github.com/llvm/llvm-project/issues/57347 Differential Revision: https://reviews.llvm.org/D132695
Loading
Please sign in to comment