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 | 7c7e531f973e59b7db03476271c955bf9130df09 (patch) | |
tree | 3790ac036fd5eaf23146855f79596484cca47fab | |
parent | 6a74bfba20489e3707673c393bf7a1495cd1506a (diff) | |
download | bcm5719-llvm-7c7e531f973e59b7db03476271c955bf9130df09.tar.gz bcm5719-llvm-7c7e531f973e59b7db03476271c955bf9130df09.zip |
PR31978: Don't crash if CodeGen sees a top-level BindingDecl.
llvm-svn: 345362
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 1 | ||||
-rw-r--r-- | clang/test/Parser/cxx1z-decomposition.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e889b9ff328..3cc96af181d 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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/clang/test/Parser/cxx1z-decomposition.cpp b/clang/test/Parser/cxx1z-decomposition.cpp index cf4ba77723a..1e184a7fac5 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; }; |