Skip to content

Commit a922d69

Browse files
committed
Workaround for gcc bug 85282
1 parent 92b5b24 commit a922d69

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/luxrays/core/namedobjectvector.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ class NamedObjectVector {
102102
template<typename T>
103103
std::unique_ptr<T> DeleteObj(const std::string &name);
104104

105+
// Workaround for gcc bug 85282 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282)
106+
#ifndef __GNUG__
105107
template<> // Specialization for NamedObject; other types will rely on it
106108
std::unique_ptr<NamedObject> DeleteObj<NamedObject>(const std::string &name);
109+
#endif
107110

108111
void DeleteObjs(const std::vector<std::string> &names);
109112

@@ -169,13 +172,20 @@ class NamedObjectVector {
169172
};
170173

171174

172-
173175
// Specialization (declaration) of DefineObj for NamedObject class, so that
174176
// derived classes can rely on it
175177
template<>
176178
std::tuple< NamedObject&, std::unique_ptr<NamedObject> >
177179
NamedObjectVector::DefineObj(std::unique_ptr<NamedObject>&& obj);
178180

181+
182+
// Workaround for gcc bug 85282 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282)
183+
#ifdef __GNUG__
184+
template<> // Specialization for NamedObject; other types will rely on it
185+
std::unique_ptr<NamedObject>
186+
NamedObjectVector::DeleteObj<NamedObject>(const std::string &name);
187+
#endif
188+
179189
// Out-of-class definition for DeleteObj
180190
template<typename T>
181191
std::unique_ptr<T> NamedObjectVector::DeleteObj(const std::string &name) {
@@ -186,6 +196,7 @@ std::unique_ptr<T> NamedObjectVector::DeleteObj(const std::string &name) {
186196
return std::move(oldDerivedPtr);
187197
}
188198

199+
189200
} // Namespace luxrays
190201

191202
#endif /* _LUXRAYS_NAMEDOBJECTVECTOR_H */

0 commit comments

Comments
 (0)