public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26605]  New: enable_if + using troubles
@ 2006-03-08 13:43 pcarlini at suse dot de
  2006-03-08 13:57 ` [Bug c++/26605] using + templates troubles pcarlini at suse dot de
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: pcarlini at suse dot de @ 2006-03-08 13:43 UTC (permalink / raw)
  To: gcc-bugs

EDG-based compilers accept (in strict mode) accept this:

template<typename T>
  struct is_void
  { static const bool value = false; };

template<>
  struct is_void<void>
  { static const bool value = true; };

template<typename, bool>
  struct enable_if { };

template<typename T>
  struct enable_if<T, true>
  { typedef T type; };

namespace one
{
  template<typename T>
    typename enable_if<double, is_void<T>::value>::type
    fun(T);
}

namespace two
{
  using one::fun;

  template<typename T>
    typename enable_if<double, !is_void<T>::value>::type
    fun(T);
}

/////////////

paolo:~/Work> g++ -c reduced.cc
reduced.cc:29: error: 'template<class T> typename enable_if<double, (!
is_void<T>::value)>::type two::fun(T)' conflicts with previous using
declaration 'template<class T> typename enable_if<double,
is_void<T>::value>::type one::fun(T)'


-- 
           Summary: enable_if + using troubles
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pcarlini at suse dot de


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


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <bug-26605-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2013-09-02  9:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-08 13:43 [Bug c++/26605] New: enable_if + using troubles pcarlini at suse dot de
2006-03-08 13:57 ` [Bug c++/26605] using + templates troubles pcarlini at suse dot de
2006-03-08 14:01 ` pcarlini at suse dot de
2006-03-08 14:07 ` pinskia at gcc dot gnu dot org
2006-03-08 14:11 ` pcarlini at suse dot de
2006-03-08 14:15 ` pcarlini at suse dot de
2006-03-08 14:21 ` pinskia at gcc dot gnu dot org
2006-03-08 14:24 ` pcarlini at suse dot de
2006-03-08 14:56 ` pcarlini at suse dot de
2006-03-08 16:20 ` [Bug c++/26605] using + function " pcarlini at suse dot de
2006-03-08 22:28 ` mmitchel at gcc dot gnu dot org
2006-03-08 22:36 ` pcarlini at suse dot de
2006-03-10  9:38 ` pcarlini at suse dot de
     [not found] <bug-26605-4@http.gcc.gnu.org/bugzilla/>
2013-09-02  9:44 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).