[llvm-bugs] [Bug 37794] New: using type before its definition in template struct

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 13 14:30:49 PDT 2018


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

            Bug ID: 37794
           Summary: using type before its definition in template struct
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mib.bugzilla at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

For this test case on godbolt / clang 6 an error is produced. gcc7 and icc
compile without error. 
template<class T>
struct C {
  struct Nested {
    Nested(typename C::mytype);
  };
  typedef int mytype; // workaround - move typedef before Nested
};

C<int> c;


bug.cpp:4:24: error: no type named 'mytype' in 'C<T>'
    Nested(typename C::mytype);
           ~~~~~~~~~~~~^~~~~~
1 error generated.
compilation aborted for bug.cpp (code 1)

--Melanie Blower, I work for Intel on the Intel c++ compiler

-- 
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/20180613/c1faa0ec/attachment.html>


More information about the llvm-bugs mailing list