<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 --- - Behavior of "using" statement with template inheritance does not work as expected and differs from gcc."
   href="http://llvm.org/bugs/show_bug.cgi?id=15371">15371</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Behavior of "using" statement with template inheritance does not work as expected and differs from gcc.
          </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>FreeBSD
          </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>jmunxsys@yahoo.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>Created <span class=""><a href="attachment.cgi?id=10092" name="attach_10092" title="C++ file that shows the issue.">attachment 10092</a> <a href="attachment.cgi?id=10092&action=edit" title="C++ file that shows the issue.">[details]</a></span>
C++ file that shows the issue.

I have attached a file that compiles with GCC, but not clang. I'm not sure this
is a problem, but it's not the behavior I expected. 

I don't expect to need "PACIFY_CLANG" defined because of the using statement,
and I'd expect that the gcc version would work again because of the using
statement at the beginning of Derived.


Below is the behavior I'm seeing: 

LaptopBSD> /Storage/scratch/tools/bin/clang++ -v
clang version 3.3 (trunk 176074)
Target: x86_64-unknown-freebsd9.0
Thread model: posix
LaptopBSD> /Storage/scratch/tools/bin/clang++ -c test.cc
test.cc:38:13: error: out-of-line definition of 'Derived::get_ptr' differs from
      the declaration in the return type
Derived<A>::get_ptr() const 
            ^
test.cc:26:7: note: previous declaration is here
    * get_ptr() const;
      ^
1 error generated.
LaptopBSD> /Storage/scratch/tools/bin/clang++ -DPACIFY_CLANG_ANGER_GCC=1 -c
test.cc
LaptopBSD> /Storage/scratch/tools/bin/clang++ -DPACIFY_CLANG=1 -c test.cc
LaptopBSD> /usr/local/bin/g++48 -DPACIFY_CLANG=1 -c test.cc
LaptopBSD> /usr/local/bin/g++48 -DPACIFY_CLANG_ANGER_GCC=1 -c test.cc
test.cc:38:1: error: prototype for 'const typename Derived<A>::Data*
Derived<A>::get_ptr() const' does not match any in class 'Derived<A>'
 Derived<A>::get_ptr() const 
 ^
test.cc:26:7: error: candidate is: const typename Base<A>::Data*
Derived<A>::get_ptr() const
     * get_ptr() const;
       ^
LaptopBSD> /usr/local/bin/g++48 -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++48
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd9.0/4.8.0/lto-wrapper
Target: x86_64-portbld-freebsd9.0
Configured with: ./../gcc-4.8-20130113/configure --disable-nls
--libdir=/usr/local/lib/gcc48 --libexecdir=/usr/local/libexec/gcc48
--program-suffix=48 --with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/
--with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local
--with-pkgversion='FreeBSD Ports Collection' --with-system-zlib
--disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local
--mandir=/usr/local/man --infodir=/usr/local/info/gcc48
--build=x86_64-portbld-freebsd9.0
Thread model: posix
gcc version 4.8.0 20130113 (experimental) (FreeBSD Ports Collection)</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>