r217997 - Skip parens when detecting whether we're instantiating a function declaration.

Richard Smith richard at metafoo.co.uk
Thu Sep 18 11:59:24 PDT 2014


On Thu, Sep 18, 2014 at 10:16 AM, Renato Golin <renato.golin at linaro.org>
wrote:

> Hi Richard,
>
> Have you had time to look at this?
>
> http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/21803


I was not aware of that. Is the bot misconfigured? It didn't send me any
mail. The patch has been reverted; I'll take a look before it goes back in.

cheers,
> --renato
>
> On 18 September 2014 01:12, Richard Smith <richard-llvm at metafoo.co.uk>
> wrote:
> > Author: rsmith
> > Date: Wed Sep 17 19:12:09 2014
> > New Revision: 217997
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=217997&view=rev
> > Log:
> > Skip parens when detecting whether we're instantiating a function
> declaration.
> >
> > Modified:
> >     cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
> >     cfe/trunk/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
> >
> > Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=217997&r1=217996&r2=217997&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
> > +++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Wed Sep 17 19:12:09
> 2014
> > @@ -1577,8 +1577,8 @@ TypeSourceInfo *Sema::SubstFunctionDeclT
> >
> >    QualType Result;
> >
> > -  // FIXME: What if the function type is parenthesized?
> > -  if (FunctionProtoTypeLoc Proto = TL.getAs<FunctionProtoTypeLoc>()) {
> > +  if (FunctionProtoTypeLoc Proto =
> > +          TL.IgnoreParens().getAs<FunctionProtoTypeLoc>()) {
> >      // Instantiate the type, other than its exception specification. The
> >      // exception specification is instantiated in
> InitFunctionInstantiation
> >      // once we've built the FunctionDecl.
> >
> > Modified:
> cfe/trunk/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp?rev=217997&r1=217996&r2=217997&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
> (original)
> > +++ cfe/trunk/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp Wed
> Sep 17 19:12:09 2014
> > @@ -58,6 +58,13 @@ namespace dr1330_example {
> >      S().f<S>(); // ok
> >      S().f<int>(); // expected-note {{instantiation of exception spec}}
> >    }
> > +
> > +  template<typename T>
> > +  struct U {
> > +    void f() noexcept(T::error);
> > +    void (g)() noexcept(T::error);
> > +  };
> > +  U<int> uint; // ok
> >  }
> >
> >  namespace core_19754_example {
> >
> >
> > _______________________________________________
> > 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/20140918/ac207af7/attachment.html>


More information about the cfe-commits mailing list