[LLVMbugs] [Bug 12651] New: clang should have a fixit for missing typename in sizeof expressions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 24 21:38:07 PDT 2012


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

             Bug #: 12651
           Summary: clang should have a fixit for missing typename in
                    sizeof expressions
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


clang suggests missing "typename"s almost everywhere. It doesn't in this case:

C:\src\chrome\src>type test2.cc
template<class T>
int f(const T& unused) {
  return sizeof(T::a);
}

struct A {
  typedef int a;
};

int g() {
  A a;
  return f(a);
}

C:\src\chrome\src>..\..\llvm-build\bin\Release\clang.exe -c test2.cc
test2.cc:3:20: error: unexpected type name 'a': expected expression
  return sizeof(T::a);
                   ^
test2.cc:12:10: note: in instantiation of function template specialization
'f<A>' requested here
  return f(a);
         ^
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.



More information about the llvm-bugs mailing list