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

            Bug ID: 22278
           Summary: terrible diagnostic for missing 'typename'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

template<int N> struct Y { typedef int type; };
template<int N> void h() {
  struct alignas(N) X {};
  Y<alignof(X)>::type z;
}

gives:

<stdin>:4:4: error: expected ';' after expression
  Y<alignof(X)>::type z;
   ^
   ;
<stdin>:4:23: error: use of undeclared identifier 'z'
  Y<alignof(X)>::type z;
                      ^

This is hopeless, and this is a really obvious case: we have a template-name
followed by a less-than.

Also note that we give a bogus fixit (why do we think a semicolon is a great
thing to insert before a '<'?), and don't recover as if the fixit is applied.

-- 
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