[Bug c++/65923] False positive for warning about literal operator suffix and using

2016-03-31 Thread richardg.work at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65923

Richard Geary  changed:

   What|Removed |Added

 CC||richardg.work at gmail dot com

--- Comment #2 from Richard Geary  ---
This is still present in g++ 5.3.0, and also affects
std::literals::string_literals. The flag -Wno-literal-suffix does not turn it
off.  Thus -Werror builds will fail, despite the C++ being clean.

A workaround is to use 'using namespace std::literals::chrono_literals;' but
having a 'using namespace' in a header file is usually considered bad practice.

Please can someone fix this?

[Bug c++/71568] New: Inexplicable error: "X is inaccessible within this context" for a public member

2016-06-17 Thread richardg.work at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71568

Bug ID: 71568
   Summary: Inexplicable error: "X is inaccessible within this
context" for a public member
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: richardg.work at gmail dot com
  Target Milestone: ---

Created attachment 38717
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38717&action=edit
Demonstration of the error & a possible workaround

The attached 90 line test.cpp fails to compile with an inexplicable error
message :  "X is inaccessible within this context".  The X is clearly a public
member, so this is not a C++ private memeber issue.  Critically, the same code
compiles without issue on the clang compiler (clang 3.7.1)

Note : Compile test.cpp with -std=c++14.

I've seen this error in unrelated template code before, but this time I've been
able to simplify it to a 90 line repro.  

Godbolt demonstrating the error : https://godbolt.org/g/Z4hDez

/tmp/gcc-explorer-compiler116517-85-12v5300/example.cpp: In instantiation of
'struct has_nlog_custom, void>':
35 : required by substitution of 'template typename
std::enable_if::value, void>::type write(NLogger&, const
Head&) [with Head = std::tuple]'
70 : required from 'typename std::enable_if<(!
has_nlog_custom::value)>::type log(NLogger&, const Head&) [with Head =
LogStructN; typename std::enable_if<(! has_nlog_custom::value)>::type =
void]'
88 : required from here
21 : error: 'void Foo0::nlog_custom(NLogger&) const' is inaccessible within
this context
struct has_nlog_custom> : std::true_type
{};
^~
78 : note: declared here
void nlog_custom(NLogger & nl) const {}
^~~
21 : error: 'void Foo0::nlog_custom(NLogger&) const' is inaccessible within
this context
struct has_nlog_custom> : std::true_type
{};
^~
78 : note: declared here
void nlog_custom(NLogger & nl) const {}
^~~
Compilation failed


I have a workaround, changing the #if between 0 & 1 toggles the error.  But I
don't believe that I've found the root cause of the issue.  It would be very
helpful to either diagnose this as a gcc bug, or have gcc provide more
diagnostic information on the root cause.

Thanks

[Bug c++/78771] New: Internal compiler error when using inherited constructors

2016-12-11 Thread richardg.work at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78771

Bug ID: 78771
   Summary: Internal compiler error when using inherited
constructors
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: richardg.work at gmail dot com
  Target Milestone: ---

The code below generates an internal compiler error.

Godbolt : https://godbolt.org/g/kgkbqy

: In substitution of 'template D2::D2(U) [with U = int]':
:23:12:   required by substitution of 'template D2::D2(U)
[with U = int]'
:26:28:   required from here
:23:12: internal compiler error: in instantiate_template_1, at
cp/pt.c:16113
using D1::D1;
  ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

First observed on Fedora 22 (gcc 5.4.0 built from source)


template 
struct StrictType
{
  template 
  StrictType(U) = delete;

  constexpr StrictType(T t) : m_value(t) {}

  T m_value {};
};

struct D2;

struct D1 : StrictType
{
using StrictType::StrictType;
D1(D2);
};

struct D2 : D1
{
using D1::D1;
};

D1::D1(D2 v) : D1(v.m_value) {}