/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // test that templated types are sufficiently unique'd by the frontend, so that // it doesn't conflate different types template struct Tuple {}; int bad_packed_templates() { Tuple> x; return 1 / 0; } typedef decltype(nullptr) nullptr_t; template struct NullPtrTemplate {}; int bad_nullptr_templates() { NullPtrTemplate x1; return 1 / 0; } template struct IntTemplate {}; template struct CharTemplate {}; template struct LongTemplate {}; int bad_integral_types_templates() { IntTemplate<0> x2; CharTemplate<'c'> x3; LongTemplate<1234567890L> x4; return 1 / 0; } template struct PointerTypeTemplate {}; int array_is_pointer_type[10]; template struct PointerTypeTemplate2 {}; int array_of_size_5[5]; template struct FunctionPointerTemplate {}; void some_fun(int); struct SomeStruct {}; template struct ReferenceTypeTemplate {}; SomeStruct some_struct; int bad_reference_and_pointer_templates() { PointerTypeTemplate a; PointerTypeTemplate2 c; FunctionPointerTemplate<&some_fun> d; ReferenceTypeTemplate b; return 1 / 0; }