Skip to content

Commit

Permalink
add bug example with g++ compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchabannes committed Aug 24, 2024
1 parent adc60de commit 5ff0208
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FetchContent_MakeAvailable(Catch2)
add_library( napp_test_lib1 lib1.cpp)
target_link_libraries(napp_test_lib1 PRIVATE ${NAPP_TARGET_NAME} )

file(GLOB files unit-*.cpp)
file(GLOB files unit-*.cpp bug-ftbs-*.cpp)
foreach(file ${files})
get_filename_component(file_basename ${file} NAME_WE)
#string(REGEX REPLACE "unit-([^$]+)" "test-\\1" testcase ${file_basename})
Expand Down
27 changes: 27 additions & 0 deletions test/bug-ftbs-gcc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <napp/na.hpp>

using element1 = NA::named_argument_t<struct element1_tag>;
constexpr auto& _element1 = NA::identifier<element1>;

template <typename Ts>
void func( Ts && v )
{
// body
}

// NOTE: g++ compilation error only when use a template
template <typename T>
class Foo
{
public:
Foo(){
func( _element1=("toto") ); // error
func( _element1.operator=("toto") ); // OK
}
};

int main()
{
Foo<int> a;
return 0;
}

0 comments on commit 5ff0208

Please sign in to comment.