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: unassignedclangb...@nondot.org
          Reporter: tangyix...@mail.dlut.edu.cn
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to