OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [tc1/] [dr49.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
// { dg-do compile }
2
// Contributed by: Giovanni Bajo 
3
// DR 49: Non-constant pointers are invalid template arguments.
4
 
5
template struct R { /* ... */ };
6
template struct S { /* ... */ };
7
 
8
int p;
9
template struct R<&p>; // OK
10
template struct S<&p>; // OK due to parameter adjustment
11
 
12
int *ptr;
13
template struct R; // { dg-error "constant" }
14
template struct S; // { dg-error "constant" }
15
 
16
int v[5];
17
template struct R; // OK due to implicit argument conversion
18
template struct S; // OK due to both adjustment and conversion
19
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.