public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64926] New: Variable declared in if-statement-header is in wrong scope
@ 2015-02-03 18:54 humbug at deeptown dot org
  2015-02-03 18:58 ` [Bug c++/64926] " humbug at deeptown dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: humbug at deeptown dot org @ 2015-02-03 18:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64926

            Bug ID: 64926
           Summary: Variable declared in if-statement-header is in wrong
                    scope
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: humbug at deeptown dot org

A friend of mine (Dmitry Kashitsyn) found a bug:

#include <cstdio>

int main()
{    
    if (int* x=NULL) // <<< declare 'x'
    {}
    else if(true)
    {
        std::printf("%d\n", *x); // <<< You may access 'x' inside this scope
    }
    return 0;
}


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-10 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 18:54 [Bug c++/64926] New: Variable declared in if-statement-header is in wrong scope humbug at deeptown dot org
2015-02-03 18:58 ` [Bug c++/64926] " humbug at deeptown dot org
2015-02-03 19:16 ` humbug at deeptown dot org
2015-02-03 19:30 ` pinskia at gcc dot gnu.org
2015-02-10 13:21 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).