public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56489] New: [C++11] Member type lookup fails on dependent using-declarations
@ 2013-03-01  6:17 hhhpppsss1 at hotmail dot com
  2013-03-01  9:30 ` [Bug c++/56489] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: hhhpppsss1 at hotmail dot com @ 2013-03-01  6:17 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56489
           Summary: [C++11] Member type lookup fails on dependent
                    using-declarations
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hhhpppsss1@hotmail.com


Created attachment 29558
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29558
test case

If a type alias to a template dependent type is introduced by a
using-declaration, gcc fails to lookup its member types. The following code can
be used to test this behavior:

template <typename T>
struct A
{
    using type = void;

    constexpr static int value = 0;
};

template <typename T>
void func()
{
    typedef A<T> A_typedef;
    using   A_using = A<T>;

    int value_typedef = A_typedef::value;
    int value_using   = A_using  ::value;

    using type_typedef = typename A_typedef::type;
    using type_using   = typename A_using  ::type;
}

template void func<int>();

When compiled with gcc 4.7.2 (-c -std=gnu++11), it gives an error message:

test.cpp: In instantiation of ‘void func() [with T = int]’:
test.cpp:22:25:   required from here
test.cpp:19:50: error: no type named ‘type’ in ‘using A_using = struct A<T>’


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

* [Bug c++/56489] [C++11] Member type lookup fails on dependent using-declarations
  2013-03-01  6:17 [Bug c++/56489] New: [C++11] Member type lookup fails on dependent using-declarations hhhpppsss1 at hotmail dot com
@ 2013-03-01  9:30 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-01  9:30 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-01 09:30:17 UTC ---
This is already fixed in mainline and isn't a regression.


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

end of thread, other threads:[~2013-03-01  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01  6:17 [Bug c++/56489] New: [C++11] Member type lookup fails on dependent using-declarations hhhpppsss1 at hotmail dot com
2013-03-01  9:30 ` [Bug c++/56489] " 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).