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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tc1/] [dr49.C] - Rev 783

Compare with Previous | Blame | View Log

// { dg-do compile }
// Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR 49: Non-constant pointers are invalid template arguments.

template<int *a> struct R { /* ... */ };
template<int b[5]> struct S { /* ... */ };

int p;
template struct R<&p>; // OK
template struct S<&p>; // OK due to parameter adjustment

int *ptr;
template struct R<ptr>; // { dg-error "argument" }
template struct S<ptr>; // { dg-error "argument" }

int v[5];
template struct R<v>; // OK due to implicit argument conversion
template struct S<v>; // OK due to both adjustment and conversion

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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