2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2008-11-11 14:37:55 +03:00
|
|
|
|
|
|
|
void f()
|
|
|
|
{
|
|
|
|
(void)typeid(int); // expected-error {{error: you need to include <typeinfo> before using the 'typeid' operator}}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
class type_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
void g()
|
|
|
|
{
|
|
|
|
(void)typeid(int);
|
|
|
|
}
|
2009-12-24 00:06:06 +03:00
|
|
|
|
|
|
|
struct X; // expected-note 3{{forward declaration}}
|
|
|
|
|
|
|
|
void g1(X &x) {
|
2010-03-10 14:27:22 +03:00
|
|
|
(void)typeid(X); // expected-error{{'typeid' of incomplete type 'X'}}
|
|
|
|
(void)typeid(X&); // expected-error{{'typeid' of incomplete type 'X'}}
|
|
|
|
(void)typeid(x); // expected-error{{'typeid' of incomplete type 'X'}}
|
2009-12-24 00:06:06 +03:00
|
|
|
}
|