1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <typeindex> 10 11 // class type_index 12 13 // const char* name() const; 14 15 // UNSUPPORTED: no-rtti 16 17 #include <typeindex> 18 #include <string> 19 #include <cassert> 20 21 #include "test_macros.h" 22 main(int,char **)23int main(int, char**) 24 { 25 const std::type_info& ti = typeid(int); 26 std::type_index t1 = typeid(int); 27 assert(std::string(t1.name()) == ti.name()); 28 29 return 0; 30 } 31