[llvm-branch-commits] [cfe-branch] r214692 - Merging r213613:

Bill Wendling isanbard at gmail.com
Sun Aug 3 21:35:10 PDT 2014


Author: void
Date: Sun Aug  3 23:35:10 2014
New Revision: 214692

URL: http://llvm.org/viewvc/llvm-project?rev=214692&view=rev
Log:
Merging r213613:
------------------------------------------------------------------------
r213613 | rtrieu | 2014-07-21 21:42:15 -0700 (Mon, 21 Jul 2014) | 2 lines

Fix '&' printing for template arguments in parentheses in template diffing.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_35/   (props changed)
    cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp
    cfe/branches/release_35/test/Misc/diag-template-diffing.cpp

Propchange: cfe/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Aug  3 23:35:10 2014
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:213609,213611,213741,213993,213998,214208
+/cfe/trunk:213609,213611,213613,213741,213993,213998,214208
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp?rev=214692&r1=214691&r2=214692&view=diff
==============================================================================
--- cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp (original)
+++ cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp Sun Aug  3 23:35:10 2014
@@ -994,7 +994,8 @@ class TemplateDiff {
           bool FromAddressOf = false;
           if (FromValueDecl) {
             if (FromExpr) {
-              if (UnaryOperator *UO = dyn_cast<UnaryOperator>(FromExpr)) {
+              if (UnaryOperator *UO =
+                      dyn_cast<UnaryOperator>(FromExpr->IgnoreParens())) {
                 if (UO->getOpcode() == UO_AddrOf)
                   FromAddressOf = true;
               }
@@ -1007,14 +1008,16 @@ class TemplateDiff {
           bool ToAddressOf = false;
           if (ToValueDecl) {
             if (ToExpr) {
-              if (UnaryOperator *UO = dyn_cast<UnaryOperator>(ToExpr)) {
+              if (UnaryOperator *UO =
+                      dyn_cast<UnaryOperator>(ToExpr->IgnoreParens())) {
                 if (UO->getOpcode() == UO_AddrOf) {
                   ToAddressOf = true;
                 }
               }
             } else {
-              if (!ArgumentType->isReferenceType())
+              if (!ArgumentType->isReferenceType()) {
                 ToAddressOf = true;
+              }
             }
           }
           Tree.SetNode(FromValueDecl, ToValueDecl, FromAddressOf, ToAddressOf);

Modified: cfe/branches/release_35/test/Misc/diag-template-diffing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/test/Misc/diag-template-diffing.cpp?rev=214692&r1=214691&r2=214692&view=diff
==============================================================================
--- cfe/branches/release_35/test/Misc/diag-template-diffing.cpp (original)
+++ cfe/branches/release_35/test/Misc/diag-template-diffing.cpp Sun Aug  3 23:35:10 2014
@@ -1120,9 +1120,13 @@ Wrapper<S<ptr>> W = MakeWrapper<S<&globa
 // Don't print an extra '&' for 'ptr'
 // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<ptr>>'
 
-Wrapper<S<(&global2)>> W2 = MakeWrapper<S<&global>>();
 // Handle parens correctly
-// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<global2>>'
+Wrapper<S<(&global2)>> W2 = MakeWrapper<S<&global>>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<&global2>>'
+Wrapper<S<&global2>> W3 = MakeWrapper<S<(&global)>>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<&global2>>'
+Wrapper<S<(&global2)>> W4 = MakeWrapper<S<(&global)>>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<&global2>>'
 }
 
 // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.





More information about the llvm-branch-commits mailing list