t4018: test cases showing that the cpp pattern misses many anchor points
Most of the tests show C++ code, but there is also a union definition and a GNU style function definition that are not recognized. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
02907a08cc
commit
9cc444f057
5
t/t4018/cpp-class-constructor
Normal file
5
t/t4018/cpp-class-constructor
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Item::Item(int RIGHT)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
6
t/t4018/cpp-class-constructor-mem-init
Normal file
6
t/t4018/cpp-class-constructor-mem-init
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Item::Item(int RIGHT) :
|
||||||
|
member(0)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
5
t/t4018/cpp-class-destructor
Normal file
5
t/t4018/cpp-class-destructor
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
RIGHT::~RIGHT()
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
5
t/t4018/cpp-function-returning-global-type
Normal file
5
t/t4018/cpp-function-returning-global-type
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
::Item get::it::RIGHT()
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
6
t/t4018/cpp-function-returning-nested
Normal file
6
t/t4018/cpp-function-returning-nested
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
get::Item get::it::RIGHT()
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
||||||
|
|
5
t/t4018/cpp-function-returning-reference
Normal file
5
t/t4018/cpp-function-returning-reference
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
string& get::it::RIGHT(char *ptr)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
6
t/t4018/cpp-gnu-style-function
Normal file
6
t/t4018/cpp-gnu-style-function
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
const char *
|
||||||
|
RIGHT(int arg)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
5
t/t4018/cpp-namespace-definition
Normal file
5
t/t4018/cpp-namespace-definition
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
namespace RIGHT
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
5
t/t4018/cpp-operator-definition
Normal file
5
t/t4018/cpp-operator-definition
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Value operator+(Value LEFT, Value RIGHT)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
8
t/t4018/cpp-struct-single-line
Normal file
8
t/t4018/cpp-struct-single-line
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
void wrong()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
struct RIGHT_iterator_tag {};
|
||||||
|
|
||||||
|
int ChangeMe;
|
||||||
|
// broken
|
5
t/t4018/cpp-template-function-definition
Normal file
5
t/t4018/cpp-template-function-definition
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
template<class T> int RIGHT(T arg)
|
||||||
|
{
|
||||||
|
ChangeMe;
|
||||||
|
broken;
|
||||||
|
}
|
5
t/t4018/cpp-union-definition
Normal file
5
t/t4018/cpp-union-definition
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
union RIGHT {
|
||||||
|
double v;
|
||||||
|
int ChangeMe;
|
||||||
|
broken;
|
||||||
|
};
|
Reference in New Issue
Block a user