[PATCH] D65592: [Parser] Avoid spurious 'missing template' error in presence of typos

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 10:29:34 PDT 2019


ilya-biryukov created this revision.
ilya-biryukov added a reviewer: rsmith.
Herald added a project: clang.
ilya-biryukov added a parent revision: D65591: [AST] Add a flag indicating if any subexpression had errors.

Suppress those diagnostics if lhs of a member expression contains
errors. Typo correction produces dependent expressions even in
non-template code, that led to spurious diagnostics before.

Also includes a small refactoring to improve code calling
ParseUnqualifiedId and ParseOptionalCXXScopeSpecifier in the common case
when ObjectType is null. This allows to avoid boiler plate required to
propagate whether lhs of a member expression had any errors in the
common code path.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65592

Files:
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Sema.h
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseExpr.cpp
  clang/lib/Parse/ParseExprCXX.cpp
  clang/lib/Parse/ParseOpenMP.cpp
  clang/lib/Parse/ParseStmtAsm.cpp
  clang/lib/Parse/ParseTemplate.cpp
  clang/lib/Parse/Parser.cpp
  clang/lib/Sema/SemaTemplate.cpp
  clang/test/SemaTemplate/dependent-typos-recovery.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65592.212849.patch
Type: text/x-patch
Size: 38344 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190801/ecb79e1e/attachment-0001.bin>


More information about the cfe-commits mailing list