<html>
    <head>
      <base href="https://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 --- - Error message when invoking a constructor not very helpful"
   href="https://llvm.org/bugs/show_bug.cgi?id=31806">31806</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error message when invoking a constructor not very helpful
          </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>Windows NT
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Recently a change was in r292518 which (properly) caused the following code to
no longer compile:

class A {
public:
  A(){}
  ~A(){}
};
A foo(){ return A::A(); }

Now if you try to build this code, the compiler emits the following error
message:

test3.cpp:6:20: error: qualified reference to 'A' is a constructor name rather
than a type in this context
A foo(){ return A::A(); }

The error message given here is not really clear as to what the problem is. By
comparison, the error given by GCC is much clearer:

test3.cpp: In function ‘A foo()’:
test3.cpp:6:22: error: cannot call constructor ‘A::A’ directly [-fpermissive]
 A foo(){ return A::A(); }
                      ^
test3.cpp:6:22: error:   for a function-style cast, remove the redundant ‘::A’
[-fpermissive]

We should improve this error message.</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>