[cfe-dev] -ferror-limit omits part of last error message

David Blaikie dblaikie at gmail.com
Tue Aug 16 10:33:51 PDT 2011


> What about errors that produce more than one note (like c++ function
> overload suggestions)?

I'm not sure why they would be a problem - they currently don't trip
up -ferror-limit (which I assume is counting only error diagnostics
(not notes), but then throwing out all diagnostics once it reaches the
limit)

eg:
$ cat foo.cpp
void foo(int);
void foo(double);
void foo(int, int);

int main() {
  foo();
}
$ clang++ foo.cpp -ferror-limit=2
foo.cpp:6:3: error: no matching function for call to 'foo'
  foo();
  ^~~
foo.cpp:3:6: note: candidate function not viable: requires 2 arguments, but 0
      were provided
void foo(int, int);
     ^
foo.cpp:2:6: note: candidate function not viable: requires 1 argument, but 0
      were provided
void foo(double);
     ^
foo.cpp:1:6: note: candidate function not viable: requires 1 argument, but 0
      were provided
void foo(int);
     ^

doesn't trip up -ferror-limit. It correctly doesn't count the notes as errors.



More information about the cfe-dev mailing list