remove_extent.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
10ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//===----------------------------------------------------------------------===// 20ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// 30ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// The LLVM Compiler Infrastructure 40ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// 50ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// This file is distributed under the University of Illinois Open Source 60ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// License. See LICENSE.TXT for details. 70ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// 80ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong//===----------------------------------------------------------------------===// 90ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong 100ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// type_traits 110ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong 120ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong// remove_extent 130ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong 140ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong#include <type_traits> 150ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong 160ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongenum Enum {zero, one_}; 170ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong 180ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kongint main() 190ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong{ 200ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<int>::type, int>::value), ""); 210ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<const Enum>::type, const Enum>::value), ""); 220ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<int[]>::type, int>::value), ""); 230ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<const int[]>::type, const int>::value), ""); 240ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<int[3]>::type, int>::value), ""); 250ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<const int[3]>::type, const int>::value), ""); 260ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<int[][3]>::type, int[3]>::value), ""); 270ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<const int[][3]>::type, const int[3]>::value), ""); 280ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<int[2][3]>::type, int[3]>::value), ""); 290ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<const int[2][3]>::type, const int[3]>::value), ""); 300ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<int[1][2][3]>::type, int[2][3]>::value), ""); 310ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong static_assert((std::is_same<std::remove_extent<const int[1][2][3]>::type, const int[2][3]>::value), ""); 320ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong} 330ae28bd5885b5daa526898fcf7c323dc2c3e1963Angus Kong