From jbeich@tormail.org  Sun Jul 15 03:41:40 2012
Return-Path: <jbeich@tormail.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 5A0C21065674
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Jul 2012 03:41:29 +0000 (UTC)
	(envelope-from jbeich@tormail.org)
Received: from server2.allsitecontrol.com (server2.allsitecontrol.com [63.143.36.210])
	by mx1.freebsd.org (Postfix) with ESMTP id 269D58FC1E
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Jul 2012 03:41:29 +0000 (UTC)
Received: from tor18.anonymizer.ccc.de ([31.172.30.1]:40444 helo=internal.tormail.org)
	by server2.allsitecontrol.com with esmtpsa (TLSv1:RC4-SHA:128)
	(Exim 4.77)
	(envelope-from <jbeich@tormail.org>)
	id 1Spzvr-000G9R-FY
	for FreeBSD-gnats-submit@freebsd.org; Sat, 14 Jul 2012 06:50:41 -0400
Received: from jbeich by internal.tormail.org with local (Exim 4.63)
	(envelope-from <jbeich@tormail.org>)
	id 1SpytL-000Pye-Aj
	for FreeBSD-gnats-submit@freebsd.org; Sat, 14 Jul 2012 09:44:01 +0000
Message-Id: <1SpytL-000Pye-Aj@internal.tormail.org>
Date: Sat, 14 Jul 2012 19:44:25 +1000
From: Jan Beich <jbeich@tormail.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] textproc/qt4-clucene: unbreak with libc++

>Number:         169872
>Category:       ports
>Synopsis:       [patch] textproc/qt4-clucene: unbreak with libc++
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kde
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 15 03:50:11 UTC 2012
>Closed-Date:    Thu Jul 19 17:40:27 UTC 2012
>Last-Modified:  Thu Jul 19 17:40:27 UTC 2012
>Originator:     Jan Beich
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
WITH_LIBCPLUSPLUS= # see src.conf(5)
CXX = clang++
CXXFLAGS += -stdlib=libc++
LDFLAGS += -stdlib=libc++
>Description:
../../../../src/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp:427:11: error: call to 'wcschr' is ambiguous
                          if ( _tcschr(_T("0123456789 +-"),termtext[i]) == NULL ){
                               ^~~~~~~
../../../../src/3rdparty/clucene/src/CLucene/config/repl_tchar.h:36:21: note: expanded from macro '_tcschr'
    #define _tcschr wcschr //find location of one character
                    ^~~~~~
/usr/include/wchar.h:135:10: note: candidate function
wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
         ^
/usr/include/c++/v1/cwchar:165:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
/usr/include/c++/v1/cwchar:166:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
../../../../src/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp:441:12: error: call to 'wcschr' is ambiguous
                                  if ( _tcschr(_T("0123456789 Ee.+-"),termtext[i]) == NULL ){
                                       ^~~~~~~
../../../../src/3rdparty/clucene/src/CLucene/config/repl_tchar.h:36:21: note: expanded from macro '_tcschr'
    #define _tcschr wcschr //find location of one character
                    ^~~~~~
/usr/include/wchar.h:135:10: note: candidate function
wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
         ^
/usr/include/c++/v1/cwchar:165:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
/usr/include/c++/v1/cwchar:166:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY       wchar_t* wcschr(      wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
2 errors generated.>How-To-Repeat:
>How-To-Repeat:
>Fix:
--- libcplusplus.diff begins here ---
--- src/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp~
+++ src/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp
@@ -11,6 +11,8 @@ CL_NS_USE(util)
 CL_NS_USE(index)
 CL_NS_DEF(search)
 
+using ::wcschr;
+
 FieldCacheImpl::FieldCacheImpl():
     cache(false,true){
 }
--- libcplusplus.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->kde 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Jul 15 03:50:38 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169872 

From: Raphael Kubo da Costa <rakuco@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/169872: [patch] textproc/qt4-clucene: unbreak with libc++
Date: Tue, 17 Jul 2012 16:12:42 -0300

 The CLucene copy in Qt is old and unmaintained, from what I can see, so
 I guess it doesn't make much sense to try to upstream a fix for this
 issue.
 
 On the other hand, I'm planning on talking to theraven@ if this behavior
 is really expected in libc++, as simply #includ'ing <cwchar> and adding
 `using namespace std' is enough to cause this amibiguity in the
 compilation.

From: Raphael Kubo da Costa <rakuco@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/169872: [patch] textproc/qt4-clucene: unbreak with libc++
Date: Thu, 19 Jul 2012 14:32:28 -0300

 Raphael Kubo da Costa <rakuco@FreeBSD.org> writes:
 
 > On the other hand, I'm planning on talking to theraven@ if this
 > behavior is really expected in libc++, as simply #includ'ing <cwchar>
 > and adding `using namespace std' is enough to cause this amibiguity
 > in the compilation.
 
 Right, I've talked to David, he talked to someone else and the
 conclusion is that the C++ standard is borked in this regard :-)
 
 Since there's no way to fix it either in libstdc++ or libc++, I'll apply
 your patch to work around the issue at the port level. Thanks!

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/169872: commit references a PR
Date: Thu, 19 Jul 2012 17:39:24 +0000 (UTC)

 Author: rakuco
 Date: Thu Jul 19 17:39:10 2012
 New Revision: 301174
 URL: http://svn.freebsd.org/changeset/ports/301174
 
 Log:
   Apply patch to make the port build with libc++.
   
   libc++'s cwchar header introduces an ambiguity with clang that makes a
   few different versions of wcschr() be found. Talking to theraven@ it
   looks like a problem in the C++ standard itself, so there is not much
   more to do other than working around the issue with this patch.
   
   Since the clucene copy in Qt is old and has no maintainer, there is
   not much value in committing this upstream, even though it may be
   worth a try in the future.
   
   No PORTREVISION bump, as users of libstdc++ are not affected, and no
   dependencies have been changed.
   
   PR:               ports/169872
   Submitted by:     Jan Beich <jbeich@tormail.org>
 
 Added:
   head/textproc/qt4-clucene/files/
   head/textproc/qt4-clucene/files/patch-src__3rdparty__clucene__src__CLucene__search__FieldCacheImpl.cpp   (contents, props changed)
 
 Added: head/textproc/qt4-clucene/files/patch-src__3rdparty__clucene__src__CLucene__search__FieldCacheImpl.cpp
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/textproc/qt4-clucene/files/patch-src__3rdparty__clucene__src__CLucene__search__FieldCacheImpl.cpp	Thu Jul 19 17:39:10 2012	(r301174)
 @@ -0,0 +1,11 @@
 +--- src/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp~
 ++++ src/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp
 +@@ -11,6 +11,8 @@ CL_NS_USE(util)
 + CL_NS_USE(index)
 + CL_NS_DEF(search)
 + 
 ++using ::wcschr;
 ++
 + FieldCacheImpl::FieldCacheImpl():
 +     cache(false,true){
 + }
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: rakuco 
State-Changed-When: Thu Jul 19 17:40:26 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169872 
>Unformatted:
