[cfe-commits] r142186 - in /cfe/trunk: lib/Parse/ParseDeclCXX.cpp test/Index/annotate-attribute.cpp
Erik Verbruggen
erikjv at me.com
Tue Oct 18 00:16:43 PDT 2011
On Oct 17, 2011, at 06:12 PM, Chandler Carruth <chandlerc at google.com> wrote:
On Mon, Oct 17, 2011 at 9:06 AM, Douglas Gregor <dgregor at apple.com> wrote:
Erik, if this bug affects the 3.0 branch, please ask Bill to pull this commit into the branch.
It does. Bill CC-ed.
Dunno if I still need to request it now, but better safe than sorry:
Bill, could you pull this in the 3.0 branch please? Without the patch clang will generate 2 instead of 1 AST node for each access specifier in a C++ class.
-- Erik.
- Doug
On Oct 17, 2011, at 2:54 AM, Erik Verbruggen wrote:
> Author: erikjv
> Date: Mon Oct 17 04:54:52 2011
> New Revision: 142186
>
> URL: http://llvm.org/viewvc/llvm-project?rev=142186&view=rev
> Log:
> Fixed merge-mistake where ActOnAccessSpecifier was called twice for every access specifier. The testcase has been changed to catch this too.
>
> Modified:
> cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> cfe/trunk/test/Index/annotate-attribute.cpp
>
> Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=142186&r1=142185&r2=142186&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Mon Oct 17 04:54:52 2011
> @@ -2147,11 +2147,6 @@
> SourceLocation EndLoc;
> if (Tok.is(tok::colon)) {
> EndLoc = Tok.getLocation();
> - if (Actions.ActOnAccessSpecifier(AS, ASLoc, EndLoc,
> - AccessAttrs.getList())) {
> - // found another attribute than only annotations
> - AccessAttrs.clear();
> - }
> ConsumeToken();
> } else if (Tok.is(tok::semi)) {
> EndLoc = Tok.getLocation();
> @@ -2163,7 +2158,13 @@
> Diag(EndLoc, diag::err_expected_colon)
> << FixItHint::CreateInsertion(EndLoc, ":");
> }
> - Actions.ActOnAccessSpecifier(AS, ASLoc, EndLoc);
> +
> + if (Actions.ActOnAccessSpecifier(AS, ASLoc, EndLoc,
> + AccessAttrs.getList())) {
> + // found another attribute than only annotations
> + AccessAttrs.clear();
> + }
> +
> continue;
> }
>
>
> Modified: cfe/trunk/test/Index/annotate-attribute.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-attribute.cpp?rev=142186&r1=142185&r2=142186&view=diff
> ==============================================================================
> --- cfe/trunk/test/Index/annotate-attribute.cpp (original)
> +++ cfe/trunk/test/Index/annotate-attribute.cpp Mon Oct 17 04:54:52 2011
> @@ -17,17 +17,17 @@
> };
>
> // CHECK: ClassDecl=Test:3:7 (Definition) Extent=[3:1 - 17:2]
> -// CHECK: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8]
> -// CHECK: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60]
> -// CHECK: attribute(annotate)=spiffy_method Extent=[5:18 - 5:43]
> -// CHECK: CXXAccessSpecifier=:7:1 (Definition) Extent=[7:1 - 7:43]
> -// CHECK: attribute(annotate)=works Extent=[7:23 - 7:40]
> -// CHECK: CXXMethod=anotherMethod:8:8 Extent=[8:3 - 8:23]
> -// CHECK: attribute(annotate)=works Extent=[7:23 - 7:40]
> -// CHECK: CXXAccessSpecifier=:10:1 (Definition) Extent=[10:1 - 10:53]
> -// CHECK: attribute(annotate)=investigations Extent=[10:24 - 10:50]
> -// CHECK: CXXMethod=inlineMethod:12:8 (Definition) Extent=[12:3 - 12:25]
> -// CHECK: attribute(annotate)=investigations Extent=[10:24 - 10:50]
> -// CHECK: CompoundStmt= Extent=[12:23 - 12:25]
> -// CHECK: CXXAccessSpecifier=:14:1 (Definition) Extent=[14:1 - 14:11]
> -// CHECK: CXXMethod=methodWithoutAttribute:16:8 Extent=[16:3 - 16:32]
> +// CHECK-NEXT: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8]
> +// CHECK-NEXT: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60]
> +// CHECK-NEXT: attribute(annotate)=spiffy_method Extent=[5:18 - 5:43]
> +// CHECK-NEXT: CXXAccessSpecifier=:7:1 (Definition) Extent=[7:1 - 7:43]
> +// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40]
> +// CHECK-NEXT: CXXMethod=anotherMethod:8:8 Extent=[8:3 - 8:23]
> +// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40]
> +// CHECK-NEXT: CXXAccessSpecifier=:10:1 (Definition) Extent=[10:1 - 10:53]
> +// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50]
> +// CHECK-NEXT: CXXMethod=inlineMethod:12:8 (Definition) Extent=[12:3 - 12:25]
> +// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50]
> +// CHECK-NEXT: CompoundStmt= Extent=[12:23 - 12:25]
> +// CHECK-NEXT: CXXAccessSpecifier=:14:1 (Definition) Extent=[14:1 - 14:11]
> +// CHECK-NEXT: CXXMethod=methodWithoutAttribute:16:8 Extent=[16:3 - 16:32]
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________
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/20111018/56a0b6d2/attachment.html>
More information about the cfe-commits
mailing list