Skip to content

Commit

Permalink
bug not depend of napp
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchabannes committed Aug 24, 2024
1 parent d9505ab commit 3017ad7
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions test/bug-ftbs-gcc.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
#include <napp/na.hpp>
//!

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

struct B
{
constexpr B() = default;
B(const B&) = delete;
B& operator=(const B&) = delete;

template <typename V>
constexpr A operator=(V && v) const { return A{}; }
};

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

template <typename Ts>
void func2( Ts const& v )
{

}

// 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
B b;
func( b=3 ); // error
func( b.operator=(3) ); // OK
func2( b=3 ); // OK
}
};

Expand Down

0 comments on commit 3017ad7

Please sign in to comment.