PR31978: Don't crash if CodeGen sees a top-level BindingDecl.

llvm-svn: 345362
This commit is contained in:
Richard Smith
2018-10-26 03:21:20 +00:00
parent 6a74bfba20
commit 7c7e531f97
2 changed files with 2 additions and 0 deletions

View File

@@ -4800,6 +4800,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
case Decl::TypeAliasTemplate:
case Decl::Block:
case Decl::Empty:
case Decl::Binding:
break;
case Decl::Using: // using X; [C++]
if (CGDebugInfo *DI = getModuleDebugInfo())

View File

@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++1z %s -verify -fcxx-exceptions
// RUN: not %clang_cc1 -std=c++1z %s -emit-llvm-only -fcxx-exceptions
struct S { int a, b, c; };