OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [udlit-resolve.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// { dg-options "-std=c++0x" }
3
 
4
#include 
5
#include 
6
 
7
int operator"" _foo(const char*)                  { return 0; }
8
int operator"" _foo(unsigned long long int)       { return 1; }
9
int operator"" _foo(long double)                  { return 2; }
10
int operator"" _foo(char)                         { return 3; }
11
int operator"" _foo(wchar_t)                      { return 4; }
12
int operator"" _foo(char16_t)                     { return 5; }
13
int operator"" _foo(char32_t)                     { return 6; }
14
int operator"" _foo(const char*, std::size_t)     { return 7; }
15
int operator"" _foo(const wchar_t*, std::size_t)  { return 8; }
16
int operator"" _foo(const char16_t*, std::size_t) { return 9; }
17
int operator"" _foo(const char32_t*, std::size_t) { return 10; }
18
template int operator"" _foo2()          { return 20; }
19
int operator"" _foo2(unsigned long long int)      { return 21; }
20
 
21
namespace bar {
22
int operator"" _foo(unsigned long long int)       { return 101; }
23
}
24
using namespace bar;
25
 
26
int
27
main()
28
{
29
  assert(123_foo == 101);
30
  assert(0.123_foo == 2);
31
  assert('c'_foo == 3);
32
  assert(L'c'_foo == 4);
33
  assert(u'c'_foo == 5);
34
  assert(U'c'_foo == 6);
35
  assert("abc"_foo == 7);
36
  assert(L"abc"_foo == 8);
37
  assert(u"abc"_foo == 9);
38
  assert(U"abc"_foo == 10);
39
  assert(123_foo2 == 21);
40
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.