We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 811e6c5 commit a866fd2Copy full SHA for a866fd2
clang/lib/CodeGen/ModuleBuilder.cpp
@@ -107,6 +107,11 @@ namespace clang {
107
}
108
109
llvm::Module *ReleaseModule() {
110
+ // Remove pending etc decls in case of error; the asserts in StartModule()
111
+ // will rightfully be confused otherwise, as none of the decls were
112
+ // emitted.
113
+ if (Diags.hasErrorOccurred())
114
+ Builder->clear();
115
return M.release();
116
117
0 commit comments