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

             Bug #: 50491
           Summary: [C++0x] "unexpected ast of kind using_decl" on call to
                    using'ed grandparent member function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jyass...@gcc.gnu.org
                CC: a...@google.com


$ cat test.ii
struct GrandParent {
  void *get();
};

template<class OBJ>
struct Parent : public GrandParent{
};

template<typename T>
struct Child : public Parent<T> {
  using GrandParent::get;
  void Foo() {
    void* ex = get();
  }
};

$ clang++ -std=gnu++0x -fsyntax-only test.ii

$ g++-4.6 --version
g++-4.6 (GCC) 4.6.1

$ g++-4.6 -std=gnu++0x -fsyntax-only test.ii
test.ii: In member function 'void Child<T>::Foo()':
test.ii:13:20: sorry, unimplemented: unexpected ast of kind using_decl
test.ii:13: confused by earlier errors, bailing out

$ g++-4.7svn --version
g++-4.7svn (GCC) 4.7.0 20110911 (experimental)

$ g++-4.7svn -std=gnu++0x -fsyntax-only test.ii
test.ii: In member function ‘void Child<T>::Foo()’:
test.ii:13:20: sorry, unimplemented: unexpected ast of kind using_decl
test.ii:13:20: internal compiler error: in potential_constant_expression_1, at
cp/semantics.c:8226


If I change the "get()" line to "(void)get();", g++-4.6.1 succeeds, but g++-4.7
still fails with the same error. Making GrandParent non-dependent by passing a
concrete type to Parent<> makes both versions succeed.

Reply via email to