URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 384 |
// Negative test for auto
|
// Negative test for auto
|
// { dg-options "-std=c++0x" }
|
// { dg-options "-std=c++0x" }
|
|
|
#include
|
#include
|
|
|
auto x; // { dg-error "auto" }
|
auto x; // { dg-error "auto" }
|
|
|
// If the type deduced for the template parameter U is not the same in each
|
// If the type deduced for the template parameter U is not the same in each
|
// deduction, the program is ill-formed.
|
// deduction, the program is ill-formed.
|
auto i = 42, j = 42.0; // { dg-error "auto" }
|
auto i = 42, j = 42.0; // { dg-error "auto" }
|
|
|
// New CWG issue
|
// New CWG issue
|
auto a[2] = { 1, 2 }; // { dg-error "auto" }
|
auto a[2] = { 1, 2 }; // { dg-error "auto" }
|
|
|
template
|
template
|
struct A { };
|
struct A { };
|
|
|
A A1;
|
A A1;
|
// CWG issue 625
|
// CWG issue 625
|
A A2 = A1; // { dg-error "" }
|
A A2 = A1; // { dg-error "" }
|
|
|
auto foo() { } // { dg-error "auto" }
|
auto foo() { } // { dg-error "auto" }
|
|
|
void bar(auto i) // { dg-error "incomplete|auto" }
|
void bar(auto i) // { dg-error "incomplete|auto" }
|
{
|
{
|
(void)i;
|
(void)i;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.