[cfe-commits] r155426 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/CXX/class/class.mem/p2.cpp

Richard Smith richard at metafoo.co.uk
Tue Apr 24 10:44:50 PDT 2012


This and r155424 fix recent regressions (and r155424 is apparently
necessary for stlport to build). Requesting backport!

On Mon, Apr 23, 2012 at 10:48 PM, Richard Smith
<richard-llvm at metafoo.co.uk>wrote:

> Author: rsmith
> Date: Tue Apr 24 00:48:42 2012
> New Revision: 155426
>
> URL: http://llvm.org/viewvc/llvm-project?rev=155426&view=rev
> Log:
> Don't try to delay parsing the exception specification for a data member
> of a
> class; we would never actually parse it and attach it to the type.
>
> Modified:
>    cfe/trunk/lib/Parse/ParseDecl.cpp
>    cfe/trunk/test/CXX/class/class.mem/p2.cpp
>
> Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=155426&r1=155425&r2=155426&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Apr 24 00:48:42 2012
> @@ -4270,6 +4270,8 @@
>                       D.getDeclSpec().getStorageClassSpec()
>                         != DeclSpec::SCS_typedef &&
>                       !D.getDeclSpec().isFriendSpecified());
> +      for (unsigned i = 0, e = D.getNumTypeObjects(); Delayed && i != e;
> ++i)
> +        Delayed &= D.getTypeObject(i).Kind == DeclaratorChunk::Paren;
>       ESpecType = tryParseExceptionSpecification(Delayed,
>                                                  ESpecRange,
>                                                  DynamicExceptions,
>
> Modified: cfe/trunk/test/CXX/class/class.mem/p2.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class/class.mem/p2.cpp?rev=155426&r1=155425&r2=155426&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CXX/class/class.mem/p2.cpp (original)
> +++ cfe/trunk/test/CXX/class/class.mem/p2.cpp Tue Apr 24 00:48:42 2012
> @@ -60,8 +60,16 @@
>  namespace PR12629 {
>   struct S {
>     static int (f)() throw();
> -    static int ((((((g))))() throw(int)));
> +    static int ((((((g))))() throw(U)));
> +    int (*h)() noexcept(false);
> +    static int (&i)() noexcept(true);
> +    static int (*j)() throw(U); // expected-error {{type name}} \
> +    // expected-error {{expected ')'}} expected-note {{to match}}
> +
> +    struct U {};
>   };
>   static_assert(noexcept(S::f()), "");
>   static_assert(!noexcept(S::g()), "");
> +  static_assert(!noexcept(S().h()), "");
> +  static_assert(noexcept(S::i()), "");
>  }
>
>
> _______________________________________________
> 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/20120424/9e246dc6/attachment.html>


More information about the cfe-commits mailing list