[lldb] [clang] fixing issue #64441 (PR #74814)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 23:52:57 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-lldb

Author: Jeevan Ghimire (jeevanghimire)

<details>
<summary>Changes</summary>

removing using namespace std;

and  assigning the fully qualified name for better naming in codebase

---
Full diff: https://github.com/llvm/llvm-project/pull/74814.diff


2 Files Affected:

- (modified) clang/test/Index/usrs.cpp (+1-1) 
- (modified) lldb/test/API/lang/cpp/namespace/main.cpp (+5-5) 


``````````diff
diff --git a/clang/test/Index/usrs.cpp b/clang/test/Index/usrs.cpp
index dbfa44f4b6764..2eeeb82cc5c1f 100644
--- a/clang/test/Index/usrs.cpp
+++ b/clang/test/Index/usrs.cpp
@@ -57,7 +57,7 @@ extern "C" {
 
 namespace foo_alias = foo;
 
-using namespace foo;
+//removing using namespace foo;
 
 namespace foo_alias2 = foo;
 
diff --git a/lldb/test/API/lang/cpp/namespace/main.cpp b/lldb/test/API/lang/cpp/namespace/main.cpp
index 6a8efa160766b..28d5421e1d33d 100644
--- a/lldb/test/API/lang/cpp/namespace/main.cpp
+++ b/lldb/test/API/lang/cpp/namespace/main.cpp
@@ -34,7 +34,7 @@ namespace A {
         int myfunc (int a);
         int myfunc2(int a)
         {
-             return a + 2;
+                return a + 2; //just changing tab not much
         }
         float myfunc (float f)
         {
@@ -56,10 +56,10 @@ namespace Foo = A::B;   // namespace alias
 
 using Foo::myfunc;      // using declaration
 
-using namespace Foo;    // using directive
+//removing namespace foo; for quality naming 
 
-namespace A {
-    namespace B {
+namespace fo::A {
+    namespace foo::B {
         using namespace Y;
         int k;
     }
@@ -140,5 +140,5 @@ main (int argc, char const *argv[])
     ::B::Bar bb;
     A::B::Bar ab;
     return Foo::myfunc(12) + bb.x() + ab.y() + NS1::NS2::Foo{}.bar() +
-           NS2::Foo{}.bar();
+            NS2::Foo{}.bar();
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/74814


More information about the cfe-commits mailing list