summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/rtti/tinfo1.C
blob: bd379aacef313304d29e84fbedf30da7427d9fbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Test if a local definition is in a linkonce/comdat section.
// { dg-do compile }
// { dg-final { scan-assembler "_ZTIP9CTemplateIhE\[: \t\n\]" } }
// { dg-final { scan-assembler-not "(.globl|.global)\[ 	\]+_ZTIP9CTemplateIhE" } }
// { dg-final { scan-assembler-not ".section\[^\n\r\]*_ZTIP9CTemplateIhE\[^\n\r\]*" } }


namespace std
{
  class type_info
  {
  protected:
    const char *__name;

  protected:
    explicit type_info(const char *__n): __name(__n) { }

  public:
    const char* name() const
    { return __name; }
  };
}

template<class TYPE>
class CTemplate
{
};

class CSecondModule {
public:
  CSecondModule();

private:
  const CTemplate<unsigned char> *m_variable; typedef CTemplate<unsigned char> m_variable_type;
};

CSecondModule::CSecondModule()
{
  typeid(const_cast<m_variable_type *>(m_variable)).name() != 0;
}