URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 693 |
Rev 783 |
// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-Wparentheses" }
|
// { dg-options "-Wparentheses" }
|
|
|
// Template version of Wparentheses-12.C. Note that we currently warn
|
// Template version of Wparentheses-12.C. Note that we currently warn
|
// when we initially parse the template, not when we are instantiating
|
// when we initially parse the template, not when we are instantiating
|
// it. That seems reasonable since the template parameters can not
|
// it. That seems reasonable since the template parameters can not
|
// affect the syntax parsing.
|
// affect the syntax parsing.
|
|
|
int foo (int);
|
int foo (int);
|
|
|
int a, b, c;
|
int a, b, c;
|
|
|
template
|
template
|
void
|
void
|
bar (T)
|
bar (T)
|
{
|
{
|
if (a)
|
if (a)
|
foo (0);
|
foo (0);
|
if (b)
|
if (b)
|
foo (1);
|
foo (1);
|
else
|
else
|
foo (2);
|
foo (2);
|
if (c) // { dg-warning "ambiguous" "correct warning" }
|
if (c) // { dg-warning "ambiguous" "correct warning" }
|
if (a)
|
if (a)
|
foo (3);
|
foo (3);
|
else
|
else
|
foo (4);
|
foo (4);
|
if (a)
|
if (a)
|
if (c)
|
if (c)
|
foo (5);
|
foo (5);
|
if (a)
|
if (a)
|
if (b) // { dg-warning "ambiguous" "correct warning" }
|
if (b) // { dg-warning "ambiguous" "correct warning" }
|
if (c)
|
if (c)
|
foo (6);
|
foo (6);
|
else
|
else
|
foo (7);
|
foo (7);
|
if (a) // { dg-warning "ambiguous" "correct warning" }
|
if (a) // { dg-warning "ambiguous" "correct warning" }
|
if (b)
|
if (b)
|
if (c)
|
if (c)
|
foo (8);
|
foo (8);
|
else
|
else
|
foo (9);
|
foo (9);
|
else
|
else
|
foo (10);
|
foo (10);
|
if (a)
|
if (a)
|
if (b)
|
if (b)
|
if (c)
|
if (c)
|
foo (11);
|
foo (11);
|
else
|
else
|
foo (12);
|
foo (12);
|
else
|
else
|
foo (13);
|
foo (13);
|
else
|
else
|
foo (14);
|
foo (14);
|
if (a) {
|
if (a) {
|
if (b)
|
if (b)
|
if (c)
|
if (c)
|
foo (15);
|
foo (15);
|
else
|
else
|
foo (16);
|
foo (16);
|
else
|
else
|
foo (17);
|
foo (17);
|
}
|
}
|
}
|
}
|
|
|
template void bar (int);
|
template void bar (int);
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.