Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-11964

Symbols in anon namespace are found in other translation units

    XMLWordPrintable

Details

    Description

      foo.cpp:

      namespace {
      int foo;
      }
      
      void func1()
      {
          foo = 42;
      }

      bar.cpp:

      namespace {
      int foo;
      }
      
      void func2()
      {
          foo = 84;
      }

      baz.cpp:

      enum {
          foo = 2
      };
      
      void func3()
      {
          int boo = foo;
      }

      Find Usages on any foo in anon namespace finds all of them (including the enum). Find Usages on the foo enum (both the declaration and the usage) works as expected.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            orgads Orgad Shaneh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes