<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 --- - Cv-qualification mismatch in dependent pseudo-destructor call fails to reject candidate"
   href="http://llvm.org/bugs/show_bug.cgi?id=20706">20706</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Cv-qualification mismatch in dependent pseudo-destructor call fails to reject candidate
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>hstong@ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Cv-qualification mismatch on a pseudo-destructor call can appear in a SFINAE
context.

Notwithstanding Core Issue 1920, which does not have a proposed resolution as
of R90 of the issues list, the test case below should pass.


### SOURCE:
$ cat sfinaeStrictlyNo1920.cc 
template <typename T, typename U = void>
struct A { typedef T ty; };

template <unsigned> struct NumSink { typedef void ty; };

typedef const int ConstInt;

template <typename T>
struct A<T, typename NumSink<sizeof (0 .ConstInt::~T(), 0)>::ty>
   { enum { val = 0 }; };

typedef A<int>::ty ty;


### COMPILER INVOCATION AND OUTPUT:
$ clang -cc1 -x c++ -std=c++03 sfinaeStrictlyNo1920.cc 
sfinaeStrictlyNo1920.cc:12:9: error: no type named 'ty' in 'A<int, void>'; did
you mean 'NumSink<4>::ty'?
typedef A<int>::ty ty;
        ^~~~~~~~~~
        NumSink<4>::ty
sfinaeStrictlyNo1920.cc:4:51: note: 'NumSink<4>::ty' declared here
template <unsigned> struct NumSink { typedef void ty; };
                                                  ^
1 error generated.


### EXPECTED BEHAVIOUR:
Clean compile.


### COMPILER VERSION INFO:
$ clang -v
clang version 3.6.0 (trunk 215824)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64</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>