View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001843 | NoesisGUI | C++ SDK | public | 2020-11-26 05:33 | 2020-12-01 18:26 |
| Reporter | CravenWarrior3 | Assigned To | jsantos | ||
| Priority | normal | Severity | tweak | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.0.7 | ||||
| Target Version | 3.0.8 | Fixed in Version | 3.0.8 | ||
| Summary | 0001843: Missing "template" statements in TypePropertyUtil.h | ||||
| Description | Partly into compiling a game which uses NoesisGUI, errors with the "expect primary-expression before 'char' token" format are thrown. Lines 34, 40, 46, 47, 66, 72, 84, and 90 of Include/NsCore/TypePropertyUtil.h are referenced in the error message. Adding "template" to the appropriate location on each line fixes the error and ensures successful compilation of the program afterwards. The issue is relatively minor and simple to fix although no other files generated the error message. | ||||
| Steps To Reproduce | Discovered the issue while attempting to compile Ingnomia on Ubuntu 20.10, NoesisGUI was compiled using the Debug setting. | ||||
| Attached Files | Log.txt (4,434 bytes)
Scanning dependencies of target NoesisApp
make[2]: Leaving directory '/mnt/ssd/Projects/Ingnomia/build'
make[2]: Entering directory '/mnt/ssd/Projects/Ingnomia/build'
[ 17%] Building CXX object 3rdparty/NoesisApp/CMakeFiles/NoesisApp.dir/cmake_pch.hxx.gch
In file included from /mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NoesisPCH.h:14,
from /mnt/ssd/Projects/Ingnomia/3rdparty/NoesisApp/pch.h:2,
from /mnt/ssd/Projects/Ingnomia/build/3rdparty/NoesisApp/CMakeFiles/NoesisApp.dir/cmake_pch.hxx:5,
from <command-line>:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘Noesis::Ptr<Noesis::BaseComponent> Noesis::GetComponent(const Noesis::TypeProperty*, const void*, Noesis::NonRefCountedType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:34:35: error: expected primary-expression before ‘>’ token
34 | return Boxing::Box(prop->Get<T>(ptr));
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘Noesis::Ptr<Noesis::BaseComponent> Noesis::GetComponent(const Noesis::TypeProperty*, const void*, Noesis::PtrRefCountedType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:40:53: error: expected primary-expression before ‘>’ token
40 | return DynamicPtrCast<BaseComponent>(prop->Get<T>(ptr));
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘Noesis::Ptr<Noesis::BaseComponent> Noesis::GetComponent(const Noesis::TypeProperty*, const void*, Noesis::PointerRefCountedType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:46:30: error: expected primary-expression before ‘(’ token
46 | return Ptr<BaseComponent>(const_cast<BaseComponent*>(
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:47:54: error: expected primary-expression before ‘>’ token
47 | DynamicCast<const BaseComponent*>(prop->Get<T>(ptr))));
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘void Noesis::SetComponent(const Noesis::TypeProperty*, void*, Noesis::BaseComponent*, Noesis::NonCharPointerType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:66:16: error: expected primary-expression before ‘>’ token
66 | prop->Set<T>(ptr, value != 0 ? Boxing::Unbox<T>(value) : T());
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘void Noesis::SetComponent(const Noesis::TypeProperty*, void*, Noesis::BaseComponent*, Noesis::CharPointerType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:72:16: error: expected primary-expression before ‘>’ token
72 | prop->Set<T>(ptr, value != 0 ? Boxing::Unbox<String>(value).Str() : "");
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘void Noesis::SetComponent(const Noesis::TypeProperty*, void*, Noesis::BaseComponent*, Noesis::PtrRefCountedType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:84:16: error: expected primary-expression before ‘>’ token
84 | prop->Set<T>(ptr, T(DynamicCast<typename T::Type*>(value)));
| ^
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h: In function ‘void Noesis::SetComponent(const Noesis::TypeProperty*, void*, Noesis::BaseComponent*, Noesis::PointerRefCountedType)’:
/mnt/ssd/Projects/Dependencies/NoesisGUI/Include/NsCore/TypePropertyUtil.h:90:16: error: expected primary-expression before ‘>’ token
90 | prop->Set<T>(ptr, DynamicCast<T>(value));
| ^
make[2]: *** [3rdparty/NoesisApp/CMakeFiles/NoesisApp.dir/build.make:252: 3rdparty/NoesisApp/CMakeFiles/NoesisApp.dir/cmake_pch.hxx.gch] Error 1
make[2]: Leaving directory '/mnt/ssd/Projects/Ingnomia/build'
make[1]: *** [CMakeFiles/Makefile2:312: 3rdparty/NoesisApp/CMakeFiles/NoesisApp.dir/all] Error 2
make[1]: Leaving directory '/mnt/ssd/Projects/Ingnomia/build'
make: *** [Makefile:130: all] Error 2
TypePropertyUtil.h (3,643 bytes)
////////////////////////////////////////////////////////////////////////////////////////////////////
// NoesisGUI - http://www.noesisengine.com
// Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __CORE_TYPEPROPERTYUTIL_H__
#define __CORE_TYPEPROPERTYUTIL_H__
#include <NsCore/Noesis.h>
#include <NsCore/CompilerTools.h>
#include <NsCore/String.h>
#include <NsCore/Boxing.h>
namespace Noesis
{
typedef Int2Type<0> NonRefCountedType;
typedef Int2Type<1> PtrRefCountedType;
typedef Int2Type<2> PointerRefCountedType;
typedef Int2Type<3> NonCharPointerType;
typedef Int2Type<4> CharPointerType;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// Auxiliary functions to get values from a property using boxed values or Ptr objects
////////////////////////////////////////////////////////////////////////////////////////////////////
//@{
template<class T>
Ptr<BaseComponent> GetComponent(const TypeProperty* prop, const void* ptr, NonRefCountedType)
{
return Boxing::Box(prop->template Get<T>(ptr));
}
template<class T>
Ptr<BaseComponent> GetComponent(const TypeProperty* prop, const void* ptr, PtrRefCountedType)
{
return DynamicPtrCast<BaseComponent>(prop->template Get<T>(ptr));
}
template<class T>
Ptr<BaseComponent> GetComponent(const TypeProperty* prop, const void* ptr, PointerRefCountedType)
{
return Ptr<BaseComponent>(const_cast<BaseComponent*>(
DynamicCast<const BaseComponent*>(prop->template Get<T>(ptr))));
}
template<class T>
Ptr<BaseComponent> GetComponent(const TypeProperty* prop, const void* ptr)
{
typedef RemovePointer<T> PointedType;
enum { IsRefCountedType = IsPtr<T>::Result ? 1 : IsRefCounted<PointedType>::Result ? 2 : 0 };
return GetComponent<T>(prop, ptr, Int2Type<IsRefCountedType>());
}
//@}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// Auxiliary functions to set values in a property using boxed values or Ptr objects
////////////////////////////////////////////////////////////////////////////////////////////////////
//@{
template<class T>
void SetComponent(const TypeProperty* prop, void* ptr, BaseComponent* value, NonCharPointerType)
{
prop->template Set<T>(ptr, value != 0 ? Boxing::Unbox<T>(value) : T());
}
template<class T>
void SetComponent(const TypeProperty* prop, void* ptr, BaseComponent* value, CharPointerType)
{
prop->template Set<T>(ptr, value != 0 ? Boxing::Unbox<String>(value).Str() : "");
}
template<class T>
void SetComponent(const TypeProperty* prop, void* ptr, BaseComponent* value, NonRefCountedType)
{
SetComponent<T>(prop, ptr, value, Int2Type<(int)IsSame<T, const char*>::Result + 3>());
}
template<class T>
void SetComponent(const TypeProperty* prop, void* ptr, BaseComponent* value, PtrRefCountedType)
{
prop->template Set<T>(ptr, T(DynamicCast<typename T::Type*>(value)));
}
template<class T>
void SetComponent(const TypeProperty* prop, void* ptr, BaseComponent* value, PointerRefCountedType)
{
prop->template Set<T>(ptr, DynamicCast<T>(value));
}
template<class T>
void SetComponent(const TypeProperty* prop, void* ptr, BaseComponent* value)
{
typedef RemovePointer<T> PointedType;
enum { IsRefCountedType = IsPtr<T>::Result ? 1 : IsRefCounted<PointedType>::Result ? 2 : 0 };
SetComponent<T>(prop, ptr, value, Int2Type<IsRefCountedType>());
}
//@}
}
#endif
| ||||
| Platform | Linux | ||||
|
Could you please indicate gcc version and, if possible, a patch with the changes? Thanks! |
|
|
I'm using version 10.2.0 of gcc. Here's the edited file that fixes the issue I'm having. |
|
|
Thanks for this! |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-11-26 05:33 | CravenWarrior3 | New Issue | |
| 2020-11-26 05:33 | CravenWarrior3 | Tag Attached: C++ | |
| 2020-11-26 05:33 | CravenWarrior3 | File Added: Log.txt | |
| 2020-11-26 10:49 | jsantos | Assigned To | => jsantos |
| 2020-11-26 10:49 | jsantos | Status | new => assigned |
| 2020-11-26 10:49 | jsantos | Target Version | => 3.0.8 |
| 2020-11-26 10:53 | jsantos | Status | assigned => feedback |
| 2020-11-26 10:53 | jsantos | Note Added: 0006824 | |
| 2020-11-26 15:23 | CravenWarrior3 | File Added: TypePropertyUtil.h | |
| 2020-11-26 15:23 | CravenWarrior3 | Note Added: 0006829 | |
| 2020-11-26 15:23 | CravenWarrior3 | Status | feedback => assigned |
| 2020-12-01 18:26 | jsantos | Note Added: 0006852 | |
| 2020-12-01 18:26 | jsantos | Status | assigned => resolved |
| 2020-12-01 18:26 | jsantos | Resolution | open => fixed |
| 2020-12-01 18:26 | jsantos | Fixed in Version | => 3.0.8 |