[LLVMbugs] [Bug 10310] New: function-within-namespace lookup bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 8 08:02:42 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10310

           Summary: function-within-namespace lookup bug
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ps at kr.tuwien.ac.at
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=6857)
 --> (http://llvm.org/bugs/attachment.cgi?id=6857)
the good input

attached there are two .cpp files which differ only in the way a function is
declared to be in the namespace.

*** good.E.cpp  2011-07-08 17:00:23.249503002 +0200
--- bad.E.cpp   2011-07-08 16:59:58.649503000 +0200
***************
*** 104707,104720 ****
   };
  }

! namespace LitDep
! {
! inline FormulaNode* new_clone(const FormulaNode& a)
  {
   (void)a;
   return 0;
  }
- }
  # 24 "/home/ps/Documents/potassco/trunk/gringo/libgringo/src/aggrlit.cpp" 2
  # 1
"/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/exceptions.h" 1
  # 22
"/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/exceptions.h"
--- 104707,104717 ----
   };
  }

! inline LitDep::FormulaNode* new_clone(const LitDep::FormulaNode& a)
  {
   (void)a;
   return 0;
  }
  # 24 "/home/ps/Documents/potassco/trunk/gringo/libgringo/src/aggrlit.cpp" 2
  # 1
"/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/exceptions.h" 1
  # 22
"/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/exceptions.h"

The "good" file compiles with clang 2.9 and trunk from tonight.

The "bad" complains as follows (using trunk)

In file included from
/home/ps/Documents/potassco/trunk/gringo/libgringo/src/aggrlit.cpp:1:
In file included from
/home/ps/Documents/potassco/trunk/gringo/libgringo/src/aggrlit.cpp:18:
In file included from
/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/aggrlit.h:20:
In file included from
/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/gringo.h:24:
/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/clone_ptr.h:54:21:
error: call to function 'new_clone' that is neither visible in the template
definition nor found by
      argument-dependent lookup
 : ptr_(ptr.get() ? new_clone(*ptr.get()) : 0)
                    ^
/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/formula.h:23:7:
note: in instantiation of member function
'clone_ptr<LitDep::FormulaNode>::clone_ptr' requested here
class Formula : public Locateable
      ^
/home/ps/Documents/potassco/trunk/gringo/libgringo/./gringo/litdep.h:78:29:
note: 'new_clone' should be declared prior to the call site or in namespace
'LitDep'
inline LitDep::FormulaNode* new_clone(const LitDep::FormulaNode& a)
                            ^
1 warning and 1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list