[PATCH] D134243: Don't crash when code completing `using enum ^Foo`.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 16:45:56 PDT 2022


sammccall added inline comments.


================
Comment at: clang/lib/Parse/ParseDecl.cpp:4591
     Actions.CodeCompleteTag(getCurScope(), DeclSpec::TST_enum);
+    DS.SetTypeSpecError();
     return;
----------------
this is a bit unusual, usually parse() functions just stop after hitting CC, as if they hit something unexpected.

However ParseUsingDeclaration immediately calls ActOnUsingDeclaration, which asserts that the enum specifier we parsed was one of {enum, typename, error}. It seems simpler to signal failure using the existing mechanism than add a new one - LMK what you think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134243/new/

https://reviews.llvm.org/D134243



More information about the cfe-commits mailing list