[libcxx-commits] [libcxx] c1cff4e - [libc++][Android] Rename user NS to User to avoid conflict with struct

Ryan Prichard via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 6 17:30:25 PST 2022


Author: Ryan Prichard
Date: 2022-12-06T17:28:55-08:00
New Revision: c1cff4ee431c9fba816176ba8e919ca62040f079

URL: https://github.com/llvm/llvm-project/commit/c1cff4ee431c9fba816176ba8e919ca62040f079
DIFF: https://github.com/llvm/llvm-project/commit/c1cff4ee431c9fba816176ba8e919ca62040f079.diff

LOG: [libc++][Android] Rename user NS to User to avoid conflict with struct

Bionic's sys/user.h declares a "struct user". The header tends to be
included, and when it is, it conflicts with "namespace user". Rename
user to User.

Differential Revision: https://reviews.llvm.org/D139380

Added: 
    

Modified: 
    libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/lwg3629.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/lwg3629.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/lwg3629.pass.cpp
    libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/lwg3629.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/lwg3629.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/lwg3629.pass.cpp
index edf1541e383c0..9e9e21f9fd9e7 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/lwg3629.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/lwg3629.pass.cpp
@@ -20,7 +20,7 @@ int make_error_code; // It's important that this comes before <system_error>
 #include <cassert>
 #include <type_traits>
 
-namespace user {
+namespace User {
   enum Err {};
 
   std::error_code make_error_code(Err) { return std::error_code(42, std::generic_category()); }
@@ -28,11 +28,11 @@ namespace user {
 
 namespace std {
   template <>
-  struct is_error_code_enum<user::Err> : true_type {};
+  struct is_error_code_enum<User::Err> : true_type {};
 }
 
 int main(int, char**) {
-  std::error_code e((user::Err()));
+  std::error_code e((User::Err()));
   assert(e.value() == 42);
   assert(e.category() == std::generic_category());
 

diff  --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/lwg3629.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/lwg3629.pass.cpp
index 715d8c763e1da..4e5bcc394607c 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/lwg3629.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/lwg3629.pass.cpp
@@ -20,7 +20,7 @@ int make_error_code; // It's important that this comes before <system_error>
 #include <cassert>
 #include <type_traits>
 
-namespace user {
+namespace User {
   enum Err {};
 
   std::error_code make_error_code(Err) { return std::error_code(42, std::generic_category()); }
@@ -28,12 +28,12 @@ namespace user {
 
 namespace std {
   template <>
-  struct is_error_code_enum<user::Err> : true_type {};
+  struct is_error_code_enum<User::Err> : true_type {};
 }
 
 int main(int, char**) {
   std::error_code e;
-  e = user::Err();
+  e = User::Err();
   assert(e.value() == 42);
   assert(e.category() == std::generic_category());
 

diff  --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/lwg3629.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/lwg3629.pass.cpp
index 3a7dfba62886d..2d2d43a129d70 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/lwg3629.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/lwg3629.pass.cpp
@@ -20,7 +20,7 @@ int make_error_condition; // It's important that this comes before <system_error
 #include <cassert>
 #include <type_traits>
 
-namespace user {
+namespace User {
   enum Err {};
 
   std::error_condition make_error_condition(Err) { return std::error_condition(42, std::generic_category()); }
@@ -28,11 +28,11 @@ namespace user {
 
 namespace std {
   template <>
-  struct is_error_condition_enum<user::Err> : true_type {};
+  struct is_error_condition_enum<User::Err> : true_type {};
 }
 
 int main(int, char**) {
-  std::error_condition e((user::Err()));
+  std::error_condition e((User::Err()));
   assert(e.value() == 42);
   assert(e.category() == std::generic_category());
 

diff  --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/lwg3629.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/lwg3629.pass.cpp
index 95b6f6e2d22d6..72cc77b4949d6 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/lwg3629.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/lwg3629.pass.cpp
@@ -22,7 +22,7 @@ int make_error_condition; // It's important that this comes before <system_error
 
 #include "test_macros.h"
 
-namespace user {
+namespace User {
   enum Err {};
 
   std::error_condition make_error_condition(Err) { return std::error_condition(42, std::generic_category()); }
@@ -30,12 +30,12 @@ namespace user {
 
 namespace std {
   template <>
-  struct is_error_condition_enum<user::Err> : true_type {};
+  struct is_error_condition_enum<User::Err> : true_type {};
 }
 
 int main(int, char**) {
   std::error_condition e;
-  e = user::Err();
+  e = User::Err();
   assert(e.value() == 42);
   assert(e.category() == std::generic_category());
   return 0;


        


More information about the libcxx-commits mailing list