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

            Bug ID: 61103
           Summary: False-positive, template-independent name taken as
                    dependent name
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: synxis at gmx dot fr

Created attachment 32756
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32756&action=edit
Source file containing the bug

Hello,

I use a compile-time counter in my library, and it works perfectly when used in
'normal' classes but breaks when used in template class. This behavior is
specific to gcc, as it works in template classes for VC2008->2013 and clang
3.4. 

It is based on function overloading, there are comments in the attached code
explained in more details the workflow of the timer.

I've opened a question on Stack Overflow here:
http://stackoverflow.com/questions/23525701/compile-time-counter-behavior-changing-in-a-template-class

This program outputs 2 numbers (with some sugar for human-readability) : 0 and
1 is the expected output, but gcc outputs 1 and 1.

For the version of gcc, I don't know exactly, at least the 4.8.1 (Ideone), but
the versions used by codepad or coliru also have this bug. BTW, the following
source highlights the fact that gcc 'thinks' that it 'Count' is a
dependent-name: http://coliru.stacked-crooked.com/a/daa2c7d956f9ea9a

Thank you in advance.

Reply via email to