[LLVMbugs] [Bug 22278] New: terrible diagnostic for missing 'typename'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 20 15:03:16 PST 2015


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: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150120/fb5973a1/attachment.html>


More information about the llvm-bugs mailing list