public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50491] New: [C++0x] "unexpected ast of kind using_decl" on call to using'ed grandparent member function
@ 2011-09-22 23:29 jyasskin at gcc dot gnu.org
  2011-09-22 23:40 ` [Bug c++/50491] " jyasskin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jyasskin at gcc dot gnu.org @ 2011-09-22 23:29 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: jyasskin@gcc.gnu.org
                CC: aaw@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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-23  0:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22 23:29 [Bug c++/50491] New: [C++0x] "unexpected ast of kind using_decl" on call to using'ed grandparent member function jyasskin at gcc dot gnu.org
2011-09-22 23:40 ` [Bug c++/50491] " jyasskin at gcc dot gnu.org
2011-09-22 23:52 ` [Bug c++/50491] [C++0x] [4.6/4.7 Regression] " paolo.carlini at oracle dot com
2011-09-23  0:01 ` paolo.carlini at oracle dot com
2011-09-23  0:55 ` redi at gcc dot gnu.org
2011-09-23  0:57 ` paolo at gcc dot gnu.org
2011-09-23  3:48 ` paolo at gcc dot gnu.org
2011-09-23  6:12 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).