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

            Bug ID: 23303
           Summary: this Template code might not output error message
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

The code comes from stackoverflow  http://stackoverflow.com/q/29776850/566459

// Forward declaration:
template <class S, class T>
struct Base;

template <class T>
struct BaseFriend {
    friend struct Base<int, T>;
};

// Actual declaration:
template <class S, class T = int>
struct Base {
    void foo() {}
};

struct DerivedFriend : BaseFriend<int> {};

struct Derived : Base<int> {
    void foo(int) {
        Base<int>::foo();
    }
};


G++ could successfully compile it, while using clang++ 3.6, it gives the
following error message:


error: too few template arguments for class template 'Base'
    Base<int>::foo();
    ^
test.cpp:3:8: note: template is declared here
struct Base;
       ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to