[llvm-bugs] [Bug 47814] New: clang rejects definition of iterator in -std=c++2a

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 13 04:02:58 PDT 2020


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

            Bug ID: 47814
           Summary: clang rejects definition of iterator in -std=c++2a
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tangyixuan at mail.dlut.edu.cn
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Hi, the following code definition of iterator 'a' of struct 'S2'. Although it
is invalid use of 'S2' in ISO C++17 and before, maybe it is valid in C++20 and
gcc also accepts it with -std=c++20.

$ s.cpp
template < class T > struct S1 {};
template < class T > struct S2 {
        friend class :: S1 < T >;
        S2 <T>::iterator a;
};

$ clang++ -c -std=c++20 s.cpp
s.cpp:4:17: error: no type named 'iterator' in 'S2<T>'
        S2 <T>::iterator a;
        ~~~~~~~~^
1 error generated.

-- 
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/20201013/5e04fd23/attachment.html>


More information about the llvm-bugs mailing list