diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto10.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto10.C | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto10.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto10.C new file mode 100644 index 0000000..296873e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto10.C @@ -0,0 +1,21 @@ +// Positive test for auto +// { dg-do run { target c++11 } } + +#include <typeinfo> +extern "C" void abort(); + +int main() +{ + if (auto i = 42L) + { + if (typeid (i) != typeid (long int)) + abort (); + } + + while (auto i = 1) + { + if (typeid (i) != typeid (int)) + abort (); + break; + } +} |