http://llvm.org/bugs/show_bug.cgi?id=8755

           Summary: "class X" where X names a typedef has a worse error
                    when X is templated
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


This testcase shows a case where clang emits a worse error, just due to the
template:

  template <typename T>
  struct A {
    typedef int iterator;
  };

  template <typename T>
  void f() {
    class A <T> ::iterator foo;
  }

  void g() {
    f<int>();
  }

which generates:

  b3264413.cc:8:17: error: no class named 'iterator' in 'A<int>'
    class A <T> ::iterator foo;
                  ^
  b3264413.cc:12:3: note: in instantiation of function template specialization
        'f<int>' requested here
    f<int>();
    ^
  1 error generated.

while the untemplated example:

  struct A {
    typedef int iterator;
  };

  void f() {
    class A::iterator foo;
  }

generates the much nicer:

  class.cc:6:12: error: elaborated type refers to a typedef
    class A::iterator foo;
             ^
  class.cc:2:15: note: declared here
    typedef int iterator;
                ^
  1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to