| 1 |
// PR c++/34094 |
| 2 |
// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } } |
| 3 |
// { dg-require-effective-target nonpic } |
| 4 |
// Skip on vxworks kernel: The link being partial, the linker doesn't see |
| 5 |
// the undefined reference |
| 6 |
// { dg-skip-if "partial link" { vxworks_kernel } } |
| 7 |
// { dg-options "-gdwarf-2" } |
| 8 |
// Ignore additional message on powerpc-ibm-aix |
| 9 |
// { dg-prune-output "obtain more information" } */ |
| 10 |
// Ignore additional messages on Linux/x86 with PIE |
| 11 |
// { dg-prune-output "\[Bb\]ad value" } */ |
| 12 |
|
| 13 |
namespace { |
| 14 |
struct c |
| 15 |
{ |
| 16 |
static const bool t = 0; |
| 17 |
}; |
| 18 |
} |
| 19 |
|
| 20 |
const bool &f() |
| 21 |
{ |
| 22 |
return c::t; // { dg-message "\[Uu\]ndefined" "undefined" { target *-*-* } 0 } |
| 23 |
// Some targets report the error for the previous line, others |
| 24 |
// don't give line number inforamtion for it, so use line 0. |
| 25 |
} |
| 26 |
|
| 27 |
int main(void) |
| 28 |
{ |
| 29 |
return 0; |
| 30 |
} |
| 31 |
|