<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Name Hiding is not properly handled."
   href="http://llvm.org/bugs/show_bug.cgi?id=17731">17731</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Name Hiding is not properly handled.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zhaoshiz@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu, richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat name-hiding.cpp
// Hide class name with a function name
void foo1 () {
  class C {
  public:
    C() {}
    ~C() {}
  };
  int C();
  int ti = C();
  class C tc;
}

void goo1 () {
  int C();
  class C {
  public:
    C() {}
    ~C() {}
  };
  int ti = C();
  class C tc;
}

$ clang++ -target arm-none-linux-gnueabi -mfloat-abi=softfp -mfpu=neon
--sysroot=~/build_tools/gcc-4.6.1-cs/arm-2011.09 -Os -mthumb -c name-hiding.cpp

name-hiding.cpp:17:12: error: reference to 'C' is ambiguous
  int ti = C();
           ^

name-hiding.cpp:17:7: error: no viable conversion from 'C' to 'int'
  int ti = C();
      ^    ~~~

name-hiding.cpp:28:12: error: reference to 'C' is ambiguous
  int ti = C();
           ^

name-hiding.cpp:28:7: error: no viable conversion from 'C' to 'int'
  int ti = C();
      ^    ~~~

2 warnings and 4 errors generated.

(Warnings and notes are removed for clarity.)

>From C++ lang spec:

A class name or enumeration name can be hidden by the name of a variable, data
member,
function, or enumerator declared in the same scope. If a class or enumeration
name and a variable, data
member, function, or enumerator are declared in the same scope (in any order)
with the same name, the
class or enumeration name is hidden wherever the variable, data member,
function, or enumerator name is
visible.

Seems to related to this commit:

commit a41c97a5d1912ffd184381d269fd8e5a25ee5e59
Author: Richard Smith <<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>>
Date:   Fri Sep 20 01:15:31 2013 +0000

    Switch the semantic DeclContext for a block-scope declaration of a function
or
    variable from being the function to being the enclosing namespace scope (in
    C++) or the TU (in C). This allows us to fix a selection of related issues
    where we would build incorrect redeclaration chains for such declarations,
and
    fail to notice type mismatches.

    Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
    which is only found when searching scopes, and not found when searching
    DeclContexts. Such a declaration is only made visible in its DeclContext if
    there are no non-LocalExtern declarations.


    git-svn-id: <a href="https://llvm.org/svn/llvm-project/cfe/trunk@191064">https://llvm.org/svn/llvm-project/cfe/trunk@191064</a>
91177308-0d34-0410-b5e6-96231b3b80d8</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>