* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / udlit-namespace.C
blob73298900b42943f58416ffc11af9c6c497d36bae
1 // { dg-do run { target c++11 } }
3 // Test user-defined literals.
4 // Test simple operator declaration and definition in namespaces.
6 #include <cmath>
7 #include <limits>
9 namespace Long
11   long double operator"" _LL(long double);
14 namespace Short
16   short
17   operator"" _SS(long double x)
18   { return std::fmod(x, static_cast<long double>(std::numeric_limits<short>::max())); }
21 void
22 test1()
24   long double x = Long::operator "" _LL(1.2L);
26   using namespace Short;
27   short s = operator"" _SS(1.2L);
28   short s2 = 1.2_SS;
31 int
32 main()
34   test1();
37 namespace Long
39   long double
40   operator"" _LL(long double x)
41   { return x + 2.0L; }