file1.cpp 1.49 KB
Newer Older
1 2
// Copyright header

3 4
#define GENERATE_FUNC void myFunctionGenerated() {}

5 6 7 8
//
// Symbols in a global namespace
//

9 10
GENERATE_FUNC

11 12 13 14
int myVariable;

int myFunction(bool yesno, int number) {}

15
struct Pos {};
16
void pointOfService() {}
17
int matchArgument(Pos p) { return 0; }
18 19
int positiveNumber() { return 2; }

20 21 22 23 24 25
enum MyEnum { V1, V2 };

class MyClass
{
public:
    MyClass() {}
26 27
    int functionDeclaredOnly();
    int functionDefinedInClass(bool yesno, int number) {}
28
    int functionDefinedOutSideClass(char c);
29 30
};

31 32
int MyClass::functionDefinedOutSideClass(char c) {}

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
//
// Symbols in a named namespace
//

namespace MyNamespace {

int myVariable;

int myFunction(bool yesno, int number) {}

enum MyEnum { V1, V2 };

class MyClass
{
public:
    MyClass() {}
49 50
    int functionDeclaredOnly();
    int functionDefinedInClass(bool yesno, int number) {}
51 52
    int functionDefinedOutSideClass(char c);
    int functionDefinedOutSideClassAndNamespace(float x);
53 54
};

55 56
int MyClass::functionDefinedOutSideClass(char c) {}

57 58
} // namespace MyNamespace

59 60
int MyNamespace::MyClass::functionDefinedOutSideClassAndNamespace(float x) {}

61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
//
// Symbols in an anonymous namespace
//

namespace {

int myVariable;

int myFunction(bool yesno, int number) {}

enum MyEnum { V1, V2 };

class MyClass
{
public:
    MyClass() {}
77 78
    int functionDeclaredOnly();
    int functionDefinedInClass(bool yesno, int number) {}
79
    int functionDefinedOutSideClass(char c);
80 81
};

82 83
int MyClass::functionDefinedOutSideClass(char c) {}

84
} // anonymous namespace
85 86 87


int main() {}