[cfe-commits] r85545 - in /cfe/trunk: include/clang/AST/TypeLoc.h lib/Sema/TreeTransform.h test/CXX/dcl.decl/dcl.meaning/dcl.ref/p5.cpp

Douglas Gregor dgregor at apple.com
Fri Oct 30 11:52:23 PDT 2009


On Oct 29, 2009, at 5:06 PM, John McCall wrote:

> Author: rjmccall
> Date: Thu Oct 29 19:06:24 2009
> New Revision: 85545
>
> URL: http://llvm.org/viewvc/llvm-project?rev=85545&view=rev
> Log:
> Report accurate source-location information when rebuilding types  
> during
> template instantiation.

Nice!

> +struct RefPtr {
> +  typedef
> +          int
> +              &
> +                *       // expected-error {{declared as a pointer  
> to a reference}}
> +                  intrefptr;
> +
> +  typedef
> +          intref
> +                 *      // expected-error {{declared as a pointer  
> to a reference}}
> +                   intrefptr2;
> +
> +  int
> +      &
> +        *               // expected-error {{declared as a pointer  
> to a reference}}
> +          refptr0;
> +
> +  intref
> +         *              // expected-error {{declared as a pointer  
> to a reference}}
> +           refptr1;
> +
> +  PtrMem
> +        <
> +         int
> +            &
> +             >
> +               refptr2; // expected-note {{in instantiation}}
> +};

These are quite amusing test cases :)

	- Doug



More information about the cfe-commits mailing list