Re: [PATCH] D19131: Lit C++11 Compatibility Patch #8

2016-04-14 Thread Charles Li via cfe-commits
tigerleapgorge closed this revision.
tigerleapgorge added a comment.

Committed to Trunk in r266387


http://reviews.llvm.org/D19131



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D19131: Lit C++11 Compatibility Patch #8

2016-04-14 Thread Charles Li via cfe-commits
tigerleapgorge created this revision.
tigerleapgorge added a reviewer: rsmith.
tigerleapgorge added a subscriber: cfe-commits.

24 tests have been updated for C++11 compatibility.


CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp
  Ambiguous class member lookup has been fixed in C++11
  http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#
  Restrict the following diagnostics to C++98.
C++98: warning: lookup of 'set' in member access expression is ambiguous; 
using member of 'Value'
   note: lookup in the object type 'Value' refers here
   note: lookup from the current scope refers here

CXX/class/class.friend/p1.cpp
  Restrict the following diagnostics to C++98.
C++98 error: friends cannot be members of the declaring class

CXX/class/class.friend/p2.cpp
  Restrict the following 2 diagnostics to C++98.
C++98: warning: non-class friend type 'int' is a C++11 extension
C++98: warning: unelaborated friend declaration is a C++11 extension; 
specify 'struct' to befriend 'B0'

CXX/stmt.stmt/stmt.dcl/p3.cpp
  Definition of POD has been relaxed in C++11 such that a struct with 
  a trivial copy assignment operator is still considered POD.

  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2294.html
  In the above paper, the following clause has been crossed out.
“and has no user-declared copy assignment operator and no user-declared 
destructor” 

  For this test, struct Z is still a POD struct in C++11.
  Therefore goto can jump over Z’s instantiation without causing a compiler 
Error.
  Restrict the following to C++98
C++98: error: cannot jump from this goto statement to its label
C++98: note: jump bypasses initialization of non-POD variable

CXX/temp/temp.arg/temp.arg.nontype/p1.cpp
  C++11 accepts arbitrary literal types for non-type template parameters
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3413.html

  Change in diagnostics.
C++98: error: non-type template argument for template parameter of pointer 
type 'int *' must have its address taken
C++11: error: non-type template argument of type 'int' is not a constant 
expression
   note: read of non-const variable 'i' is not allowed in a constant 
expression
   note: declared here

  Restrict the following to C++98
C++98: warning: non-type template argument referring to object 'ki' with 
internal linkage is a C++11 extension
   Note: non-type template argument refers to object here

  Change in diagnostics.
C++98: error: non-type template argument refers to thread-local object
   note: non-type template argument refers here
C++11: error: non-type template argument of type 'int *' is not a constant 
expression
   note: template parameter is declared here

  Restrict the following to C++98
C++98: non-type template argument referring to function 'f_internal' with 
internal linkage is a C++11 extension
   note: non-type template argument refers to function here

  Change in diagnostics
C++98: error: non-type template argument refers to object 'n' that does not 
have linkage
   note: non-type template argument refers to object here
C++11: error: non-type template argument of type 'int *' is not a constant 
expression
   note: pointer to 'n' is not a constant expression
   note: declared here
   note: template parameter is declared here

  Change in diagnostics 
C++98: error: non-type template argument for template parameter of pointer 
type 'int *' must have its address taken
C++11: error: non-type template argument of type 'int *' is not a constant 
expression
   note: read of non-constexpr variable 'iptr' is not allowed in a 
constant expression
   note: declared here

CXX/temp/temp.arg/temp.arg.type/p2.cpp
  Unnamed types can now be used as template arguments in C++11
  http://stackoverflow.com/questions/5131691/what-is-an-unnamed-type-in-c
  Restrict the following diagnostics to C++98.
C++98: Warning: template argument uses unnamed type

CXX/temp/temp.fct.spec/temp.deduct/p9.cpp
  Template argument constant expression narrowing is not allowed.
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1809
  Restrict the following diagnostics to C++98.
C++98:  error: call to 'f' is ambiguous
note: candidate function
note: candidate function

CXX/temp/temp.spec/no-body.cpp
  Explicit instantiation of a template inside a nested namespace is an Error in 
C++11.
  This could be the result of the following defect fix.
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#995

  Added 3 instances of the following diagnostics.
C++11: error: explicit instantiation of 'x' must occur at global scope
   note: explicit instantiation refers here

  Also remove these 3 explicit instantiations from the -fixit runs.

CodeGenCXX/const-init.cpp
  Use constexpr instead of const in C++11 so the compiler