[PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 12:06:53 PDT 2015


sepavloff updated this revision to Diff 32085.
sepavloff added a comment.

Updated patch

Thanks to all for fruitful discussion!

The new version tries to addresses review notes. It differs from the previous version in:

- Method tryParseMisplacedModuleImport now depends only on current token and is used in loop condition. Probably a better name for it is something like skipMisplacedModuleImport.
- BalancedDelimiterTracker is updated so that it prints different message if module ended before closing bracket has been seen.
- If annot_module_begin is seen where it must not, recovery depends on context. Inside a namespace the module is imported as a recovery, a note suggesting to move import to top level is issued. Inside a class of a compound statement fatal error issued, there is no way to handle this case at upper level.


http://reviews.llvm.org/D11844

Files:
  include/clang/Basic/DiagnosticParseKinds.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Parse/Parser.h
  include/clang/Sema/Sema.h
  lib/Parse/ParseDeclCXX.cpp
  lib/Parse/ParseStmt.cpp
  lib/Parse/Parser.cpp
  lib/Sema/SemaDecl.cpp
  test/Modules/auto-module-import.m
  test/Modules/extern_c.cpp
  test/Modules/malformed.cpp
  test/Modules/misplaced.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11844.32085.patch
Type: text/x-patch
Size: 12049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150813/e9b49d3d/attachment.bin>


More information about the cfe-commits mailing list