r179914 - [analyzer] Correct the comment

Anna Zaks ganna at apple.com
Fri Apr 19 18:15:33 PDT 2013


Author: zaks
Date: Fri Apr 19 20:15:32 2013
New Revision: 179914

URL: http://llvm.org/viewvc/llvm-project?rev=179914&view=rev
Log:
[analyzer] Correct the comment

Modified:
    cfe/trunk/test/Analysis/inlining/path-notes.cpp

Modified: cfe/trunk/test/Analysis/inlining/path-notes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/path-notes.cpp?rev=179914&r1=179913&r2=179914&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/path-notes.cpp (original)
+++ cfe/trunk/test/Analysis/inlining/path-notes.cpp Fri Apr 19 20:15:32 2013
@@ -253,10 +253,9 @@ public:
 const A& testDeclRefExprToReferenceInGetDerefExpr(const A *ptr) {
   const A& val = *ptr; //expected-note {{'val' initialized here}}
 
-  // This is not valid C++; dynamic_cast with a reference type will throw an
-  // exception if the pointer does not match the expected type. However, our
-  // implementation of dynamic_cast will pass through a null pointer...or a
-  // "null reference"! So this branch is actually possible.
+  // This is not valid C++; if 'ptr' were null, creating 'ref' would be illegal.
+  // However, this is not checked at runtime, so this branch is actually
+  // possible.
   if (&val == 0) { //expected-note {{Assuming pointer value is null}}
                    // expected-note at -1 {{Taking true branch}}
     val.bar(); // expected-warning {{Called C++ object pointer is null}}
@@ -4285,12 +4284,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:         <key>end</key>
 // CHECK-NEXT:          <array>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>3</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>4</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
@@ -4306,12 +4305,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:         <key>start</key>
 // CHECK-NEXT:          <array>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>3</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>4</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
@@ -4319,12 +4318,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:         <key>end</key>
 // CHECK-NEXT:          <array>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>7</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>7</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
@@ -4336,7 +4335,7 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:      <key>kind</key><string>event</string>
 // CHECK-NEXT:      <key>location</key>
 // CHECK-NEXT:      <dict>
-// CHECK-NEXT:       <key>line</key><integer>260</integer>
+// CHECK-NEXT:       <key>line</key><integer>259</integer>
 // CHECK-NEXT:       <key>col</key><integer>7</integer>
 // CHECK-NEXT:       <key>file</key><integer>0</integer>
 // CHECK-NEXT:      </dict>
@@ -4344,12 +4343,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:      <array>
 // CHECK-NEXT:        <array>
 // CHECK-NEXT:         <dict>
-// CHECK-NEXT:          <key>line</key><integer>260</integer>
+// CHECK-NEXT:          <key>line</key><integer>259</integer>
 // CHECK-NEXT:          <key>col</key><integer>7</integer>
 // CHECK-NEXT:          <key>file</key><integer>0</integer>
 // CHECK-NEXT:         </dict>
 // CHECK-NEXT:         <dict>
-// CHECK-NEXT:          <key>line</key><integer>260</integer>
+// CHECK-NEXT:          <key>line</key><integer>259</integer>
 // CHECK-NEXT:          <key>col</key><integer>15</integer>
 // CHECK-NEXT:          <key>file</key><integer>0</integer>
 // CHECK-NEXT:         </dict>
@@ -4369,12 +4368,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:         <key>start</key>
 // CHECK-NEXT:          <array>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>7</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>260</integer>
+// CHECK-NEXT:            <key>line</key><integer>259</integer>
 // CHECK-NEXT:            <key>col</key><integer>7</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
@@ -4382,12 +4381,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:         <key>end</key>
 // CHECK-NEXT:          <array>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>262</integer>
+// CHECK-NEXT:            <key>line</key><integer>261</integer>
 // CHECK-NEXT:            <key>col</key><integer>5</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
 // CHECK-NEXT:           <dict>
-// CHECK-NEXT:            <key>line</key><integer>262</integer>
+// CHECK-NEXT:            <key>line</key><integer>261</integer>
 // CHECK-NEXT:            <key>col</key><integer>7</integer>
 // CHECK-NEXT:            <key>file</key><integer>0</integer>
 // CHECK-NEXT:           </dict>
@@ -4399,7 +4398,7 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:      <key>kind</key><string>event</string>
 // CHECK-NEXT:      <key>location</key>
 // CHECK-NEXT:      <dict>
-// CHECK-NEXT:       <key>line</key><integer>262</integer>
+// CHECK-NEXT:       <key>line</key><integer>261</integer>
 // CHECK-NEXT:       <key>col</key><integer>5</integer>
 // CHECK-NEXT:       <key>file</key><integer>0</integer>
 // CHECK-NEXT:      </dict>
@@ -4407,12 +4406,12 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:      <array>
 // CHECK-NEXT:        <array>
 // CHECK-NEXT:         <dict>
-// CHECK-NEXT:          <key>line</key><integer>262</integer>
+// CHECK-NEXT:          <key>line</key><integer>261</integer>
 // CHECK-NEXT:          <key>col</key><integer>5</integer>
 // CHECK-NEXT:          <key>file</key><integer>0</integer>
 // CHECK-NEXT:         </dict>
 // CHECK-NEXT:         <dict>
-// CHECK-NEXT:          <key>line</key><integer>262</integer>
+// CHECK-NEXT:          <key>line</key><integer>261</integer>
 // CHECK-NEXT:          <key>col</key><integer>7</integer>
 // CHECK-NEXT:          <key>file</key><integer>0</integer>
 // CHECK-NEXT:         </dict>
@@ -4430,10 +4429,10 @@ const A& testDeclRefExprToReferenceInGet
 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is null</string>
 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
 // CHECK-NEXT:   <key>issue_context</key><string>testDeclRefExprToReferenceInGetDerefExpr</string>
-// CHECK-NEXT:   <key>issue_hash</key><string>9</string>
+// CHECK-NEXT:   <key>issue_hash</key><string>8</string>
 // CHECK-NEXT:   <key>location</key>
 // CHECK-NEXT:   <dict>
-// CHECK-NEXT:    <key>line</key><integer>262</integer>
+// CHECK-NEXT:    <key>line</key><integer>261</integer>
 // CHECK-NEXT:    <key>col</key><integer>5</integer>
 // CHECK-NEXT:    <key>file</key><integer>0</integer>
 // CHECK-NEXT:   </dict>





More information about the cfe-commits mailing list