Skip to content

Commit 9f1f1c7

Browse files
Merge pull request #3235 from AiraYumi/poc_cpp23
Adding C++23 compatibility in a dev branch to test internal builds as well.
2 parents 4c27c94 + f0fa9ae commit 9f1f1c7

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
# autobuild-package.xml.
7373
AUTOBUILD_VCS_INFO: "true"
7474
AUTOBUILD_VSVER: "170"
75-
DEVELOPER_DIR: "/Applications/Xcode_16.0.app/Contents/Developer"
75+
DEVELOPER_DIR: "/Applications/Xcode_16.1.app/Contents/Developer"
7676
# Ensure that Linden viewer builds engage Bugsplat.
7777
BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }}
7878
build_coverity: false

indra/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ else()
2929
set( USE_AUTOBUILD_3P ON )
3030
endif()
3131

32-
set(CMAKE_CXX_STANDARD 20)
32+
set(CMAKE_CXX_STANDARD 23)
3333
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3434

3535
include(Variables)

indra/newview/llpanelface.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,7 @@ class PBRPickerAgentListener : public LLInventoryObserver
18381838
mChangePending = false;
18391839
}
18401840
};
1841+
void std::default_delete<PBRPickerAgentListener>::operator()(PBRPickerAgentListener * ptr) const noexcept { delete ptr; }
18411842

18421843
// One-off listener that updates the build floater UI when the prim inventory updates
18431844
class PBRPickerObjectListener : public LLVOInventoryListener
@@ -1877,6 +1878,7 @@ class PBRPickerObjectListener : public LLVOInventoryListener
18771878
mChangePending = false;
18781879
}
18791880
};
1881+
void std::default_delete<PBRPickerObjectListener>::operator()(PBRPickerObjectListener * ptr) const noexcept { delete ptr; }
18801882

18811883
void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool& has_faces_without_pbr, bool force_set_values)
18821884
{

indra/newview/llpanelface.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ class LLRadioGroup;
5757
class PBRPickerAgentListener;
5858
class PBRPickerObjectListener;
5959

60+
// This is specializations are needed to support std::unique_ptr<T> where T is an incomplete type
61+
namespace std {
62+
template<> struct default_delete<PBRPickerAgentListener> {
63+
constexpr default_delete() noexcept = default;
64+
void operator()(PBRPickerAgentListener* ptr) const noexcept;
65+
};
66+
template<> struct default_delete<PBRPickerObjectListener> {
67+
constexpr default_delete() noexcept = default;
68+
void operator()(PBRPickerObjectListener* ptr) const noexcept;
69+
};
70+
}
71+
6072
// Represents an edit for use in replicating the op across one or more materials in the selection set.
6173
//
6274
// The apply function optionally performs the edit which it implements

indra/newview/llterrainpaintmap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,13 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewe
815815
}
816816

817817
template<typename T>
818-
LLTerrainQueue<T>::LLTerrainQueue(LLTerrainQueue<T>& other)
818+
LLTerrainQueue<T>::LLTerrainQueue(const LLTerrainQueue<T>& other)
819819
{
820820
*this = other;
821821
}
822822

823823
template<typename T>
824-
LLTerrainQueue<T>& LLTerrainQueue<T>::operator=(LLTerrainQueue<T>& other)
824+
LLTerrainQueue<T>& LLTerrainQueue<T>::operator=(const LLTerrainQueue<T>& other)
825825
{
826826
mList = other.mList;
827827
return *this;
@@ -890,14 +890,14 @@ LLTerrainPaintQueue::LLTerrainPaintQueue(U8 components)
890890
llassert(mComponents == LLTerrainPaint::RGB || mComponents == LLTerrainPaint::RGBA);
891891
}
892892

893-
LLTerrainPaintQueue::LLTerrainPaintQueue(LLTerrainPaintQueue& other)
893+
LLTerrainPaintQueue::LLTerrainPaintQueue(const LLTerrainPaintQueue& other)
894894
: LLTerrainQueue<LLTerrainPaint>(other)
895895
, mComponents(other.mComponents)
896896
{
897897
llassert(mComponents == LLTerrainPaint::RGB || mComponents == LLTerrainPaint::RGBA);
898898
}
899899

900-
LLTerrainPaintQueue& LLTerrainPaintQueue::operator=(LLTerrainPaintQueue& other)
900+
LLTerrainPaintQueue& LLTerrainPaintQueue::operator=(const LLTerrainPaintQueue& other)
901901
{
902902
LLTerrainQueue<LLTerrainPaint>::operator=(other);
903903
mComponents = other.mComponents;

indra/newview/llterrainpaintmap.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class LLTerrainQueue
6565
{
6666
public:
6767
LLTerrainQueue() = default;
68-
LLTerrainQueue(LLTerrainQueue<T>& other);
69-
LLTerrainQueue& operator=(LLTerrainQueue<T>& other);
68+
LLTerrainQueue(const LLTerrainQueue<T>& other);
69+
LLTerrainQueue& operator=(const LLTerrainQueue<T>& other);
7070

7171
bool enqueue(std::shared_ptr<T>& t, bool dry_run = false);
7272
size_t size() const;
@@ -113,8 +113,8 @@ class LLTerrainPaintQueue : public LLTerrainQueue<LLTerrainPaint>
113113
LLTerrainPaintQueue() = delete;
114114
// components determines what type of LLTerrainPaint is allowed. Must be 3 (RGB) or 4 (RGBA)
115115
LLTerrainPaintQueue(U8 components);
116-
LLTerrainPaintQueue(LLTerrainPaintQueue& other);
117-
LLTerrainPaintQueue& operator=(LLTerrainPaintQueue& other);
116+
LLTerrainPaintQueue(const LLTerrainPaintQueue& other);
117+
LLTerrainPaintQueue& operator=(const LLTerrainPaintQueue& other);
118118

119119
bool enqueue(LLTerrainPaint::ptr_t& paint, bool dry_run = false);
120120
bool enqueue(LLTerrainPaintQueue& queue);

0 commit comments

Comments
 (0)