mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 14:16:08 +00:00

Consider the following piece of code: ``` void func( int aa, int bb, int cc) {} void arity_mismatch() { func(2, 4); } ``` BEFORE: ``` source.cpp:6:3: error: no matching function for call to 'func' 6 | func(2, 4); | ^~~~ source.cpp:1:6: note: candidate function not viable: requires 3 arguments, but 2 were provided 1 | void func( int aa, | ^ ``` AFTER: ``` source.cpp:6:3: error: no matching function for call to 'func' 6 | func(2, 4); | ^~~~ source.cpp:1:6: note: candidate function not viable: requires 3 arguments, but 2 were provided 1 | void func( int aa, | ^ ~~~~~~~ 2 | int bb, | ~~~~~~~ 3 | int cc) {} | ~~~~~~ ``` Reviewed By: cjdb, aaron.ballman Differential Revision: https://reviews.llvm.org/D153267
15 lines
471 B
C++
15 lines
471 B
C++
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s --strict-whitespace
|
|
|
|
// CHECK: error: no matching function for call to 'func'
|
|
|
|
// CHECK: :{[[@LINE+1]]:12-[[@LINE+1]]:18}: note: {{.*}} requires single argument
|
|
void func( int aa ) {}
|
|
// CHECK: :{[[@LINE+1]]:12-[[@LINE+3]]:18}: note: {{.*}} requires 3 arguments
|
|
void func( int aa,
|
|
int bb,
|
|
int cc) {}
|
|
|
|
void arity_mismatch() {
|
|
func(2, 4);
|
|
}
|