[llvm-bugs] [Bug 27961] New: Using declaration refers into C, which is a base class (alias) of D, but it is not recognized as valid.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 1 01:44:32 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27961

            Bug ID: 27961
           Summary: Using declaration refers into C, which is a base class
                    (alias) of D, but it is not recognized as valid.
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: michele.caini at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider the following code:

    struct B { };

    template<typename...>
    struct D;

    template<typename T, typename U, typename... A>
    struct D<T, U, A...>: D<U, A...> {
        using C = D<U, A...>; // (1)
        // using D<U, A...>::D; // (2)
        // using C::C  // (3)
        using C::D;
    };

    template<typename T>
    struct D<T>: T { using T::T; };

    int main() {
        D<int, double, B> d{};
    }

Lines (2) and (3) work as expected, while (1) gives the following errors:

    11 : error: dependent using declaration resolved to type without 'typename'
    using C::D;

    [...]

    11 : error: using declaration refers into 'C::', which is not a base class
of 'D<int, double, B>'
    using C::D;

C is an alias of D<U, A...>, that is a base class of D<T, U, A...>, thus even
(1) should compile.
Actually, GCC compiles the example above without errors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160601/d84f2f18/attachment.html>


More information about the llvm-bugs mailing list