diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C new file mode 100644 index 000000000..b523bb38c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C @@ -0,0 +1,10 @@ +// { dg-options -std=c++0x } + +#include <typeinfo> + +struct A { virtual void f(); }; + +extern constexpr const std::type_info* p1 = &typeid(int); +extern constexpr const std::type_info* p2 = &typeid(A); +// typeid-expression whose operand is of a polymorphic class type +extern constexpr const std::type_info* p3 = &typeid((A())); // { dg-error "" "" { xfail *-*-* } } |