r209955 - PR12961 - Extend DR532 to cover C++98/03.

Nikola Smiljanic popizdeh at gmail.com
Mon Jun 2 20:05:47 PDT 2014


I wasn't aware of this directory, it does seem like a better place. Moved
in r210064. Thanks.


On Sat, May 31, 2014 at 9:00 PM, Edoardo P. <ed0.88.prez at gmail.com> wrote:

> Hi,
> I'd like to say that, IMHO, DR532 test should be moved to a more
> proper place, like test/CXX/drs/dr5xx.cpp .
> What do you think about this?
>
> 2014-05-31 4:11 GMT+02:00 Nikola Smiljanic <popizdeh at gmail.com>:
> > Author: nikola
> > Date: Fri May 30 21:10:59 2014
> > New Revision: 209955
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=209955&view=rev
> > Log:
> > PR12961 - Extend DR532 to cover C++98/03.
> >
> > Removed:
> >     cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
> > Modified:
> >     cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
> >     cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3.cpp
> >
> > Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=209955&r1=209954&r2=209955&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
> > +++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Fri May 30 21:10:59 2014
> > @@ -4178,34 +4178,24 @@ static bool isAtLeastAsSpecializedAs(Sem
> >      // otherwise, the ordering rules for static functions against
> non-static
> >      // functions don't make any sense.
> >      //
> > -    // C++98/03 doesn't have this provision, so instead we drop the
> > -    // first argument of the free function, which seems to match
> > -    // existing practice.
> > +    // C++98/03 doesn't have this provision but we've extended DR532 to
> cover
> > +    // it as wording was broken prior to it.
> >      SmallVector<QualType, 4> Args1;
> >
> > -    unsigned Skip1 = 0, Skip2 = 0;
> >      unsigned NumComparedArguments = NumCallArguments1;
> >
> >      if (!Method2 && Method1 && !Method1->isStatic()) {
> > -      if (S.getLangOpts().CPlusPlus11) {
> > -        // Compare 'this' from Method1 against first parameter from
> Method2.
> > -        AddImplicitObjectParameterType(S.Context, Method1, Args1);
> > -        ++NumComparedArguments;
> > -      } else
> > -        // Ignore first parameter from Method2.
> > -        ++Skip2;
> > +      // Compare 'this' from Method1 against first parameter from
> Method2.
> > +      AddImplicitObjectParameterType(S.Context, Method1, Args1);
> > +      ++NumComparedArguments;
> >      } else if (!Method1 && Method2 && !Method2->isStatic()) {
> > -      if (S.getLangOpts().CPlusPlus11)
> > -        // Compare 'this' from Method2 against first parameter from
> Method1.
> > -        AddImplicitObjectParameterType(S.Context, Method2, Args2);
> > -      else
> > -        // Ignore first parameter from Method1.
> > -        ++Skip1;
> > +      // Compare 'this' from Method2 against first parameter from
> Method1.
> > +      AddImplicitObjectParameterType(S.Context, Method2, Args2);
> >      }
> >
> > -    Args1.insert(Args1.end(), Proto1->param_type_begin() + Skip1,
> > +    Args1.insert(Args1.end(), Proto1->param_type_begin(),
> >                   Proto1->param_type_end());
> > -    Args2.insert(Args2.end(), Proto2->param_type_begin() + Skip2,
> > +    Args2.insert(Args2.end(), Proto2->param_type_begin(),
> >                   Proto2->param_type_end());
> >
> >      // C++ [temp.func.order]p5:
> >
> > Removed:
> cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp?rev=209954&view=auto
> >
> ==============================================================================
> > ---
> cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
> (original)
> > +++
> cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp
> (removed)
> > @@ -1,52 +0,0 @@
> > -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
> > -// expected-no-diagnostics
> > -
> > -// Core DR 532.
> > -namespace PR8130 {
> > -  struct A { };
> > -
> > -  template<class T> struct B {
> > -    template<class R> int &operator*(R&);
> > -  };
> > -
> > -  template<class T, class R> float &operator*(T&, R&);
> > -  void test() {
> > -    A a;
> > -    B<A> b;
> > -    int &ir = b * a;
> > -  }
> > -}
> > -
> > -namespace OperatorWithRefQualifier {
> > -  struct A { };
> > -  template<class T> struct B {
> > -    template<class R> int &operator*(R&) &&;
> > -  };
> > -
> > -  template<class T, class R> float &operator*(T&&, R&);
> > -  void test() {
> > -    A a;
> > -    B<A> b;
> > -    float &ir = b * a;
> > -    int &ir2 = B<A>() * a;
> > -  }
> > -}
> > -
> > -namespace OrderWithStaticMember {
> > -  struct A {
> > -    template<class T> int g(T**, int=0) { return 0; }
> > -    template<class T> static int g(T*) { return 1; }
> > -  };
> > -  void f() {
> > -    A a;
> > -    int **p;
> > -    a.g(p);
> > -  }
> > -}
> > -
> > -namespace PR17075 {
> > -  template <typename T> struct V {};
> > -  struct S { template<typename T> S &operator>>(T &t) = delete; };
> > -  template<typename T> S &operator>>(S &s, V<T> &v);
> > -  void f(S s, V<int> v) { s >> v; }
> > -}
> >
> > Modified:
> cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3.cpp?rev=209955&r1=209954&r2=209955&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3.cpp
> (original)
> > +++ cfe/trunk/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3.cpp
> Fri May 30 21:10:59 2014
> > @@ -1,18 +1,20 @@
> > -// RUN: %clang_cc1 -fsyntax-only -verify %s
> > +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
> > +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
> >  // expected-no-diagnostics
> >
> > -namespace DeduceVsMember {
> > -  template<typename T>
> > -  struct X {
> > -    template<typename U>
> > -    int &operator==(const U& other) const;
> > -  };
> > +// Core DR 532.
> > +namespace PR8130 {
> > +  struct A { };
> >
> > -  template<typename T, typename U>
> > -  float &operator==(const T&, const X<U>&);
> > +  template<class T> struct B {
> > +    template<class R> int &operator*(R&);
> > +  };
> >
> > -  void test(X<int> xi, X<float> xf) {
> > -    float& ir = (xi == xf);
> > +  template<class T, class R> float &operator*(T&, R&);
> > +  void test() {
> > +    A a;
> > +    B<A> b;
> > +    int &ir = b * a;
> >    }
> >  }
> >
> > @@ -27,3 +29,27 @@ namespace OrderWithStaticMember {
> >      a.g(p);
> >    }
> >  }
> > +
> > +#if __cplusplus >= 201103L
> > +namespace OperatorWithRefQualifier {
> > +  struct A { };
> > +  template<class T> struct B {
> > +    template<class R> int &operator*(R&) &&;
> > +  };
> > +
> > +  template<class T, class R> float &operator*(T&&, R&);
> > +  void test() {
> > +    A a;
> > +    B<A> b;
> > +    float &ir = b * a;
> > +    int &ir2 = B<A>() * a;
> > +  }
> > +}
> > +
> > +namespace PR17075 {
> > +  template <typename T> struct V {};
> > +  struct S { template<typename T> S &operator>>(T &t) = delete; };
> > +  template<typename T> S &operator>>(S &s, V<T> &v);
> > +  void f(S s, V<int> v) { s >> v; }
> > +}
> > +#endif
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
>
> --
> Mathematics is the language with which God has written the universe.
> (Galilei)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140603/2e8b8f73/attachment.html>


More information about the cfe-commits mailing list