Clang error: error reading 'A': B (err_fe_error_reading)
Jump to navigation
Jump to search
Text | error: error reading 'A': B |
---|---|
Type | Error |
Category | None |
Internal Id | err_fe_error_reading |
Internal Message | error reading '%0': %1
|
Regular Expression | (?:error|fatal error)\: error reading '(.*?)'\: (.*?)
|
First Commit | 2009-03-12 4f495980c41b Add Diagnostic files for Frontend and move a couple errors over. |
Description
Example
Flags | --analyze -xc++ -load -Xclang mychecker.so
|
|
---|---|---|
Source |
// missing plugin file
#include <clang/StaticAnalyzer/Core/BugReporter/BugType.h>
#include <clang/StaticAnalyzer/Core/CheckerRegistry.h>
namespace {
class C : public clang::ento::Checker<true> {
public:
void f(const clang::ento::CallEvent &E,
clang::ento::CheckerContext &C) const override {
}
};
}
static clang::ento::CheckerRegistry *S = 0;
void f() {
if (!S) {
S = new clang::ento::CheckerRegistry();
}
S->addChecker<C>();
}
// Plugin registration
extern "C" void clang_plugin_registerCheckers(clang::ento::CheckerRegistry &R) {
f();
R.addChecker<C>();
}
| |
Compiler Output |
clang++: warning: -load: 'linker' input unused [-Wunused-command-line-argument] error: error reading 'mychecker.so': No such file or directory <source>:2:10: fatal error: 'clang/StaticAnalyzer/Core/BugReporter/BugType.h' file not found |
Clang Internals (17.0.6)
Git Commit Message
Add Diagnostic files for Frontend and move a couple errors over. - Notably, clang now exits with an error if it can't find a file. This flushed out a bug in the CGColorSpace.c test case. :) llvm-svn: 66789
Used in Clang Sources
This section lists all occurrences of the diagnostic within the Clang's codebase. For each occurrence, an auto-extracted snipped from the source code is listed including key elements like control structures, functions, or classes. It should illustrate the conditions under which the diagnostic is activated.
clang/lib/Frontend/CompilerInstance.cpp (line 991)
// static
bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input, DiagnosticsEngine &Diags, FileManager &FileMgr, SourceManager &SourceMgr) {
// ...
if (!FileOrErr) {
// ...
if (InputFile != "-")
Diags.Report(diag::err_fe_error_reading) << InputFile << EC.message();
clang/tools/driver/cc1as_main.cpp (line 395)
static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts, DiagnosticsEngine &Diags) {
// ...
if (std::error_code EC = Buffer.getError()) {
return Diags.Report(diag::err_fe_error_reading) << Opts.InputFile << EC.message();
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/Modules/working-dir-flag.m
- error: error reading 'clang/test/Modules/working-dir-flag.m': No such file or directory