PR31978: Don't crash if CodeGen sees a top-level BindingDecl.
llvm-svn: 345362
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index e889b9f..3cc96af 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -4800,6 +4800,7 @@
case Decl::TypeAliasTemplate:
case Decl::Block:
case Decl::Empty:
+ case Decl::Binding:
break;
case Decl::Using: // using X; [C++]
if (CGDebugInfo *DI = getModuleDebugInfo())
diff --git a/clang/test/Parser/cxx1z-decomposition.cpp b/clang/test/Parser/cxx1z-decomposition.cpp
index cf4ba77..1e184a7 100644
--- a/clang/test/Parser/cxx1z-decomposition.cpp
+++ b/clang/test/Parser/cxx1z-decomposition.cpp
@@ -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; };