https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86235

            Bug ID: 86235
           Summary: g++ accept an erroneous code sample
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

The code sample is as follow:

template< int mydim, typename Traits >
class BasicGeometry
{
typedef int some_type_t;
};

template<class ctype, int mydim, int coorddim>
class MockGeometry : BasicGeometry<mydim, int>{
using typename BasicGeometry<mydim, int>::operator[]; // expected-error
{{typename is allowed for identifiers only}}
};

int main() {
   return 0;
}

g++ accepts it, but clang++ rejects it. I thought that this is a clang bug, so
I reported it to https://bugs.llvm.org/show_bug.cgi?id=37719

After reading my report, David Blaikie and Richard Smith agree that this is a
gcc bug. Shall gcc repair the problem?

Reply via email to