On 5 February 2013 20:31, Nick Lewycky <[email protected]> wrote:

> Hi Enea! This introduced a regression. I've attached an updated testcase
> to go into clang, but the affected code looks like:
>
>   template<typename T> class B;
>
>   template <typename T>
>   class A {
>     template<typename S> friend class B<S>::ty;
>   };
>   template <typename T> class B {
>     struct ty {};
>   };
>
>   void test() {
>     (void)sizeof(A<int>);
>   }
>
> you didn't update CheckFriendTypeDecl or any of its callers.
> CheckFriendTypeDecl does this:
>
>   // C++11 [class.friend]p3:
>   // A friend declaration that does not declare a function shall have one
>   // of the following forms:
>   // friend elaborated-type-specifier ;
>   // friend simple-type-specifier ;
>   // friend typename-specifier ;
>   if (getLangOpts().CPlusPlus11 && LocStart != FriendLoc)
>     Diag(FriendLoc, diag::err_friend_not_first_in_declaration) << T;
>
> what happens is that LocStart now starts at the "template" keyword while
> the FriendLoc is the "friend" keyword.
>
> I'm going to try fixing it tonight, but if I can't then I might have to
> revert it temporarily and please resubmit when you have this bug fixed.
>

I committed the fix in r174486. Please take a look, and let me know if you
have any review comments!

Nick
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to