After a compiler crash (which prints the traceback and so forth), Driver::generateCompilationDiagnostics calls BuildInputs to get a list of inputs to pass to the preprocessor. BuildInputs runs through the command-line arguments. If the original command line included "-lstdc++" this was translated into "-Z-reserved-lib-stdc++" which is marked with options::LinkerInput, so BuildInputs includes it in the list of inputs (treating it kind of like an object file).
generateCompilationDiagnostics then wants to filter out inputs the preprocessor doesn't care about. The first thing it does is check for stdin, like so: if (!strcmp(it->second->getValue(), "-")) Sadly, "-Z-reserved-lib-stdc++" is Value-less. The Values are a SmallVector, which in this case is empty, so attempting to retrieve one goes boom. There's another test immediately afterward, which is if (types::getPreprocessedType(it->first) == types::TY_INVALID) and swapping the order of those tests makes the problem go away. --paulr
PR19515.diff
Description: PR19515.diff
_______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits