[cfe-commits] r136963 - in /cfe/trunk: lib/AST/Decl.cpp test/Index/in-class-init.cpp
Nico Weber
thakis at chromium.org
Wed Aug 29 17:27:14 PDT 2012
On Fri, Aug 5, 2011 at 1:02 AM, Abramo Bagnara <abramo.bagnara at gmail.com>wrote:
> Author: abramo
> Date: Fri Aug 5 03:02:55 2011
> New Revision: 136963
>
> URL: http://llvm.org/viewvc/llvm-project?rev=136963&view=rev
> Log:
> Fixed FieldDecl source range.
>
> Added:
> cfe/trunk/test/Index/in-class-init.cpp
> Modified:
> cfe/trunk/lib/AST/Decl.cpp
>
> Modified: cfe/trunk/lib/AST/Decl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=136963&r1=136962&r2=136963&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/AST/Decl.cpp (original)
> +++ cfe/trunk/lib/AST/Decl.cpp Fri Aug 5 03:02:55 2011
> @@ -2197,8 +2197,8 @@
> }
>
> SourceRange FieldDecl::getSourceRange() const {
> - if (isBitField())
> - return SourceRange(getInnerLocStart(), getBitWidth()->getLocEnd());
> + if (const Expr *E = InitializerOrBitWidth.getPointer())
> + return SourceRange(getInnerLocStart(), E->getLocEnd());
> return DeclaratorDecl::getSourceRange();
> }
>
>
> Added: cfe/trunk/test/Index/in-class-init.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/in-class-init.cpp?rev=136963&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/Index/in-class-init.cpp (added)
> +++ cfe/trunk/test/Index/in-class-init.cpp Fri Aug 5 03:02:55 2011
> @@ -0,0 +1,6 @@
> +struct S {
> + int field = 2;
> +};
> +
> +// RUN: c-index-test -test-load-source all -std=c++0x %s | FileCheck %s
>
FYI, c-index-test doesn't understand -std, it just silently ignores that
flag. (But I'll try to teach it about that flag)
> +// CHECK: 2:7: FieldDecl=field:2:7 (Definition) Extent=[2:3 - 2:16]
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120829/3b7dabc7/attachment.html>
More information about the cfe-commits
mailing list