| 1 |
// { dg-do assemble } |
| 2 |
|
| 3 |
// Copyright (C) 1999 Free Software Foundation |
| 4 |
|
| 5 |
// by Alexandre Oliva <[email protected]> |
| 6 |
// based on bug report by Andrey Slepuhin <[email protected]> |
| 7 |
|
| 8 |
template <const int&> struct X {}; |
| 9 |
|
| 10 |
int a = 1; |
| 11 |
X<a> x; // ok, a has external linkage |
| 12 |
|
| 13 |
const int b = 2; |
| 14 |
X<b> y; // { dg-error "" "" { target c++98_only } } const b has internal linkage |
| 15 |
|
| 16 |
extern const int c; |
| 17 |
X<c> z; // ok, c has external linkage |
| 18 |
|
| 19 |
extern const int c = 3; |
| 20 |
X<c> z_; // { dg-bogus "" } using c as constant |