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

             Bug #: 12724
           Summary: invalid "redefinition of default argument" error at
                    friend declaration in class template
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Consider the following code:

---- >8 ----
void friendly( bool param = true );

template<typename T>
class Foo {
public:
    friend void friendly( bool param );
};

Foo<int> foo;
---- >8 ----

Clang++ 3.0 produces the following compilation error:

---- >8 ----
foo.cpp:6:29: error: redefinition of default argument
        friend void friendly( bool param );
                                   ^
foo.cpp:9:10: note: in instantiation of template class 'Foo<int>' requested
here
Foo<int> foo;
         ^
foo.cpp:1:21: note: previous definition is here
void friendly( bool param = true );
                    ^       ~~~~
1 error generated.
---- >8 ----

I suspect this to be a bug.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to