Merge from the pain train
[official-gcc.git] / gcc / testsuite / g++.dg / rtti / tinfo1.C
blob037ee35fc8f37da09cce7aeb3f3a9f4461a75d29
1 // Test if a local definition is in a linkonce/comdat section.
2 // { dg-do compile }
3 // { dg-final { scan-assembler "_ZTIP9CTemplateIhE\[: \t\n\]" } }
4 // { dg-final { scan-assembler-not ".globl\[    \]+_ZTIP9CTemplateIhE" } }
5 // { dg-final { scan-assembler-not ".section\[^\n\r\]*_ZTIP9CTemplateIhE\[^\n\r\]*" } }
8 namespace std
10   class type_info
11   {
12   protected:
13     const char *__name;
15   protected:
16     explicit type_info(const char *__n): __name(__n) { }
18   public:
19     const char* name() const
20     { return __name; }
21   };
24 template<class TYPE>
25 class CTemplate
29 class CSecondModule {
30 public:
31   CSecondModule();
33 private:
34   const CTemplate<unsigned char> *m_variable; typedef CTemplate<unsigned char> m_variable_type;
37 CSecondModule::CSecondModule()
39   typeid(const_cast<m_variable_type *>(m_variable)).name() != 0;