[LLVMbugs] [Bug 18443] New: [ms-compatibility] Recover better from missing 'typename' in sizeof

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 10 21:42:01 PST 2014


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

            Bug ID: 18443
           Summary: [ms-compatibility] Recover better from missing
                    'typename' in sizeof
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, rnk at google.com
    Classification: Unclassified

Consider:

struct X { typedef int type; };
template<typename T> void f() { sizeof(T::type); }
template void f<X>();

Clang diagnoses this as:

<stdin>:2:43: error: unexpected type name 'type': expected expression
template<typename T> void f() { sizeof(T::type); }
                                          ^
<stdin>:3:15: note: in instantiation of function template specialization 'f<X>'
requested here
template void f<X>();
              ^

... but this sort of thing apparently happens inside MS system headers. We
should support this case of missing 'typename' more elegantly -- perhaps we can
teach TreeTransform to cope with this during instantiation.

-- 
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/20140111/3750c618/attachment.html>


More information about the llvm-bugs mailing list