]> granicus.if.org Git - clang/commit
[DeclPrinter] Fix two cases that crash clang -ast-print.
authorArtem Belevich <tra@google.com>
Wed, 17 Jan 2018 19:29:39 +0000 (19:29 +0000)
committerArtem Belevich <tra@google.com>
Wed, 17 Jan 2018 19:29:39 +0000 (19:29 +0000)
commit62d06f7f32aef0ea61b1b9d87bb413ab79e175d5
tree00fb0caf1e550015e404b4d08ac28add80d82d26
parent9ad8e839ccc3a19ac778c1db0def658f50db3e89
[DeclPrinter] Fix two cases that crash clang -ast-print.

Both are related to handling anonymous structures.
* clang didn't handle () around an anonymous struct variable.
* clang also crashed on syntax errors that could lead to other
  syntactic constructs following the declaration of an
  anonymous struct. While the code is invalid, that's not
  a good reason to panic compiler.

Differential Revision: https://reviews.llvm.org/D41788

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322742 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/DeclPrinter.cpp
test/Sema/ast-print.c
test/SemaCXX/ast-print-crash.cpp [new file with mode: 0644]