[Bug c++/56936] New: gcc don't show error when accessing to current instantiation

vanyacpp at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Apr 12 15:08:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56936

             Bug #: 56936
           Summary: gcc don't show error when accessing to current
                    instantiation
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vanyacpp@gmail.com


I believe this code is incorrect:

template <typename T>
struct x
{
    typedef typename x<T>::asdf mytype;
};

As x<T> refers to current instantiation and asdf is not a member of current
instantiation.

clang shows a error on this code:

12.cpp:4:28: error: no type named 'asdf' in 'x<T>'
    typedef typename x<T>::asdf mytype;
            ~~~~~~~~~~~~~~~^~~~
1 error generated.



More information about the Gcc-bugs mailing list