[PATCH] D26964: Handle more declarations in DeclContextPrinter to fix -print-decl-contexts crashes

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 22 04:17:24 PST 2016


arphaman created this revision.
arphaman added reviewers: rsmith, mehdi_amini.
arphaman added a subscriber: cfe-commits.
arphaman set the repository for this revision to rL LLVM.

This patch handles more declarations in DeclContextPrinter to avoid crashes when clang is given the `-print-decl-contexts` option. I would like to get an opinion on the testing in this patch - the current `-print-decl-contexts` test doesn't check the output, so this patch follows the same testing protocol. Do you think I should also check the output of `-print-decl-contexts`?

This patch contains 7 commits that I squashed just for review to make it easier:

- DeclContextPrinter: Handle StaticAssertDecl
- DeclContextPrinter: Handle variable template declaration
- DeclContextPrinter: Handle Access specifier declaration
- DeclContextPrinter: Handle ClassTemplateSpecialization and ClassTemplatePartialSpecialization declarations
- DeclContextPrinter: Handle EmptyDecl
- DeclContextPrinter: Handle UsingDecl
- DeclContextPrinter: Handle FriendDecl

Thanks


Repository:
  rL LLVM

https://reviews.llvm.org/D26964

Files:
  lib/Frontend/ASTConsumers.cpp
  test/Coverage/ast-printing.cpp
  test/Coverage/cxx-language-features.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26964.78848.patch
Type: text/x-patch
Size: 4228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161122/4bb0f04d/attachment.bin>


More information about the cfe-commits mailing list