[Bug c++/55136] New: template class member template explicit instanciation fails if non template overload exists

2012-10-30 Thread frrrwww at gmail dot com

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55136

 Bug #: 55136
   Summary: template class member template explicit instanciation
fails if non template overload exists
Classification: Unclassified
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: frrr...@gmail.com


this code:

template 
struct A {
void f(int) {}
template void f(T2) {}
};
template void A::f(int);

fails with:

test2.cpp:6:15: error: ambiguous template specialization ‘f’ for ‘void
A::f(int)’
test2.cpp:3:10: error: candidates are: void A::f(int) [with T1 = int]
test2.cpp:4:32: error: template void A::f(T2) [with
T2 = T2; T1 = int]

The instanciation should not be ambiguous as the '' should exclude the non
template f.

Note that:

template 
struct A {
void f(int) {}
template void f(T2) {}
};
template void A::f(int);

fails as well, but I am not sufficiently standard savy to tell if this is
compliant behaviour.


[Bug c++/50418] New: nested class typedef with same name and pointing to parent class typedef

2011-09-15 Thread frrrwww at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50418

 Bug #: 50418
   Summary: nested class typedef with same name and pointing to
parent class typedef
Classification: Unclassified
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: frrr...@gmail.com


struct A
{
typedef int T;
struct B
{
typedef T T;
};
};

test.cpp:6:19: error: declaration of ‘typedef A::T A::B::T’
test.cpp:3:17: error: changes meaning of ‘T’ from ‘typedef int A::T’

It works with Comeau, Clang and VC++, gcc workaround is the following:

struct A
{
typedef int T;
struct B
{
typedef A::T T;
};
};


[Bug libstdc++/70745] New: Wrong handling of regex_constant::match_not_eow and regex_constant::match_not_bow

2016-04-20 Thread frrrwww at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70745

Bug ID: 70745
   Summary: Wrong handling of regex_constant::match_not_eow and
regex_constant::match_not_bow
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: frrrwww at gmail dot com
  Target Milestone: ---

Hello,

it seems the current regex implementation of libstdc++ does not handle
correctly the match_not_eow and match_not_bow flags.

in the _Executor _M_word_boundary method, it looks like the logic handles these
flags as disabling \b matching for beginning/end of words in general, when the
flags are intended to disable it only on the first/last position of the subject
text.

[Bug c++/68070] New: Undefined reference to default constructor of member template class

2015-10-23 Thread frrrwww at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68070

Bug ID: 68070
   Summary: Undefined reference to default constructor of member
template class
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: frrrwww at gmail dot com
  Target Milestone: ---

Hello,

When compiling the following simple program with `g++ prog.cc -Wall -Wextra
-std=c++14`

-
#include 

template
struct A
{
A() = default;
std::vector m_content;
};

void func(A a = {})
{
}

int main()
{
func();
}
-

We get the following error:

-
/tmp/ccr6nbUo.o: In function `main':
prog.cc:(.text+0x1b): undefined reference to `std::vector >::vector()'
collect2: error: ld returned 1 exit status
-

That error happens on gcc 4.9, 5.2 and 6.0, it does not happen on clang for
this specific code.

An alternative version of the code:

-
#include 

template
struct A
{
A() = default;
A(int) {}
std::vector m_content;
};

struct B { A a; };

void func(B b = {})
{
}

int main()
{
func();
}
-

gets this error:

-
/tmp/ccvOFE5O.o: In function `main':
prog.cc:(.text+0x33): undefined reference to `A::A()'
collect2: error: ld returned 1 exit status
-