| 1 |
/* { dg-do compile } */ |
| 2 |
|
| 3 |
class CString |
| 4 |
{ |
| 5 |
public: |
| 6 |
CString(); |
| 7 |
~CString() { operator delete(_rep); } |
| 8 |
operator const char*() const { return _rep; } |
| 9 |
private: |
| 10 |
CString(char* cstr); |
| 11 |
char* _rep; |
| 12 |
}; |
| 13 |
|
| 14 |
class String |
| 15 |
{ |
| 16 |
public: |
| 17 |
|
| 18 |
String(); |
| 19 |
String(const char* str); |
| 20 |
~String(); |
| 21 |
CString getCString() const; |
| 22 |
}; |
| 23 |
|
| 24 |
int is_absolute_path(const char *path); |
| 25 |
|
| 26 |
inline void getAbsolutePath( |
| 27 |
const char* path, |
| 28 |
const String& filename) |
| 29 |
{ |
| 30 |
(!is_absolute_path(filename.getCString()) && path); |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
int foo(int &value); |
| 35 |
|
| 36 |
int main(int argc, char** argv) |
| 37 |
{ |
| 38 |
int repeatTestCount = 0; |
| 39 |
if (foo(repeatTestCount)) |
| 40 |
{ |
| 41 |
repeatTestCount = 1; |
| 42 |
} |
| 43 |
for (int numTests = 1; numTests <= repeatTestCount; numTests++) |
| 44 |
{ |
| 45 |
getAbsolutePath("blah", "blah"); |
| 46 |
} |
| 47 |
return 0; |
| 48 |
} |