Hi,

Attached is a trivial patch that's addressing the bug
http://llvm.org/bugs/show_bug.cgi?id=8025.
I can't seem to find a way to unit-test the location markers from the
output but I've just started hacking on Clang so I might be missing
something.

Best regards,
Jakub Wieczorek
Index: lib/Sema/SemaDeclCXX.cpp
===================================================================
--- lib/Sema/SemaDeclCXX.cpp	(wersja 118033)
+++ lib/Sema/SemaDeclCXX.cpp	(kopia robocza)
@@ -843,6 +843,11 @@
   DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
   DeclarationName Name = NameInfo.getName();
   SourceLocation Loc = NameInfo.getLoc();
+
+  // For anonymous bitfields, the location should point to the type.
+  if (Loc.isInvalid())
+    Loc = D.getSourceRange().getBegin();
+
   Expr *BitWidth = static_cast<Expr*>(BW);
   Expr *Init = static_cast<Expr*>(InitExpr);
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to