diff options
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype-33837.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype-33838.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C | 17 |
3 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-33837.C b/gcc/testsuite/g++.dg/cpp0x/decltype-33837.C new file mode 100644 index 0000000..35689fb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-33837.C @@ -0,0 +1,7 @@ +// { dg-options -std=c++0x } +// PR c++/33837 +void foo() +{ + __decltype (A::foo()); // { dg-error "was not declared|expected initializer" } + __decltype (B); // { dg-error "was not declared" } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-33838.C b/gcc/testsuite/g++.dg/cpp0x/decltype-33838.C new file mode 100644 index 0000000..260a0d1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-33838.C @@ -0,0 +1,6 @@ +// { dg-options -std=c++0x } +// PR c++/33838 +template<typename T> struct A +{ + __decltype (T* foo()); // { dg-error "expected|no arguments|accept" } +}; diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C b/gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C new file mode 100644 index 0000000..8e3c824 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C @@ -0,0 +1,17 @@ +// { dg-options "-std=c++0x" } +// PR c++/33045 +int && f (); + +template<typename T, typename U> +struct is_same +{ + static const bool value = false; +}; + +template<typename T> +struct is_same<T, T> +{ + static const bool value = true; +}; + +static_assert(is_same<decltype(f()), int&&>::value, "decltype of rvalue reference"); |