https://llvm.org/bugs/show_bug.cgi?id=25182
Bug ID: 25182 Summary: Typedef return type + Fully Qualified name for a member function causes error in out-of-line definition Product: clang Version: 3.7 Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: a...@gha.st CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified When defining a member function out of line with its fully qualified name and a return type that is a type alias, clang will cause an error. Consider the following example: // compiled with clang++ -std=c++14 file.cpp using test_t = int; struct S { test_t f(); }; // This will error out with: // error: 'test_t' (aka 'int') is not a class, namespace, or enumeration test_t ::S::f() { return 0; } // Defining it like this will compile correctly: // test_t S::f() { return 0; } // The following also works: // int ::S::f() { return 0; } // a main function so it links correctly: int main() { } This bug appears with both the following clang++ versions: $ clang++ -v clang version 3.7.0 (tags/RELEASE_370/final) Target: x86_64-unknown-linux-gnu Thread model: posix Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0 Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0 Found candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/5.2.0 Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0 Candidate multilib: .;@m64 Selected multilib: .;@m64 $ clang++ -v Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin15.0.0 Thread model: posix -- 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