diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-17 19:13:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-17 19:13:00 +0000 |
commit | f1d594864b4aefc1fe21535cb43e8a81038f3f15 (patch) | |
tree | f9826e140ad7203000f31788e26b5c0b6cc685d1 /test/Misc/error-limit-multiple-notes.cpp | |
parent | cc0de8c08128023544dd0c9c7ee67b105fed2985 (diff) |
Fix -ferror-limit= to properly emit notes following the last error
messages. Fi from David Blaikie, tests from Nikola Smiljanic!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Misc/error-limit-multiple-notes.cpp')
-rw-r--r-- | test/Misc/error-limit-multiple-notes.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Misc/error-limit-multiple-notes.cpp b/test/Misc/error-limit-multiple-notes.cpp new file mode 100644 index 0000000000..019b4dde26 --- /dev/null +++ b/test/Misc/error-limit-multiple-notes.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s + +// error and three notes emitted +void foo(int); +void foo(double); +void foo(int, int); + +int main() +{ + foo(); +} + +// error and note suppressed by error-limit +struct s1{}; +struct s1{}; + +// CHECK: 10:5: error: no matching function for call to 'foo' +// CHECK: 6:6: note: candidate function not viable: requires 2 arguments, but 0 were provided +// CHECK: 5:6: note: candidate function not viable: requires 1 argument, but 0 were provided +// CHECK: 4:6: note: candidate function not viable: requires 1 argument, but 0 were provided +// CHECK: fatal error: too many errors emitted, stopping now +// CHECK-NOT: 15:8: error: redefinition of 's1' +// CHECK-NOT: 14:8: note: previous definition is here |