https://bugs.llvm.org/show_bug.cgi?id=35496
Bug ID: 35496
Summary: Template argument-dependent lookup fails to find a
function in unnamed namespace
Product: clang
Version: 5.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: trupwsza...@o2.pl
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Created attachment 19507
--> https://bugs.llvm.org/attachment.cgi?id=19507&action=edit
File reproducing the issue.
Template function fails to find operator>> overloading, when the operator>>
function is defined in unnamed namespace. Error message:
c1.cpp:16:9: error: call to function 'operator>>' that is neither visible in
the template definition nor found by argument-dependent lookup
iss >> result;
^
c1.cpp:39:15: note: in instantiation of function template specialization
'Bar::convert<Bar::Foo>' requested here
return !bar.convert("bar foo", foo);
^
c1.cpp:27:17: note: 'operator>>' should be declared prior to the call site or
in the global namespace
std::istream& operator>>(std::istream& is, Bar::Foo& foo)
I think it should compile as unnamed namespace specifies internal linkage like
static keyword. When unnamed namespace is replaced with static keyword the code
compiles, so the behavior seems pretty inconsistent.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs