[llvm-bugs] [Bug 37867] New: declaration conflicts with target of using declaration already in scope

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 19 23:09:20 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37867

            Bug ID: 37867
           Summary: declaration conflicts with target of using declaration
                    already in scope
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The code is as follow:

namespace Name {
 template <class T> class Point;
}

using Name::Point;

template <class T> class Point {
 public:
 Point() {}
 protected:
 T member;
};

int main(void) {
 Name::Point<double> d;
 return(0);
}

clang++ rejects the code with error messages:
error: declaration conflicts with target of using declaration already in scope
    template <class T> class Point {
error: implicit instantiation of undefined template 'Name::Point<double>'
     Name::Point<double> d;

g++ accepts the code. The code comes from a gcc bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1876

Is this a bug in clang++?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180620/507965df/attachment.html>


More information about the llvm-bugs mailing list