diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-10-26 03:21:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-10-26 03:21:20 +0000 |
commit | f5c1e73379b7519edf0c7dc7efaf2a2daa948cf6 (patch) | |
tree | e48d10b2c67b31792b8e55855cc64633871822a9 | |
parent | 74203139fd465ef897b10886118e1ac45fe04bc2 (diff) |
PR31978: Don't crash if CodeGen sees a top-level BindingDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345362 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 1 | ||||
-rw-r--r-- | test/Parser/cxx1z-decomposition.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index e889b9ff32..3cc96af181 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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()) diff --git a/test/Parser/cxx1z-decomposition.cpp b/test/Parser/cxx1z-decomposition.cpp index cf4ba77723..1e184a7fac 100644 --- a/test/Parser/cxx1z-decomposition.cpp +++ b/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; }; |