[LLVMbugs] [Bug 7715] New: clang++ gives wrong error about default argument in kdatetime.h

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 26 02:21:23 PDT 2010


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

           Summary: clang++ gives wrong error about default argument in
                    kdatetime.h
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ambrop7 at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5268)
 --> (http://llvm.org/bugs/attachment.cgi?id=5268)
Preprocessed source

Trying to compile a program that includes KDE's kdatetime.h results in the
errors:

In file included from a.cpp:1:
/usr/include/kdatetime.h:535:62: error: use of default argument to function
'Spec' that is declared later in class 'Spec'
    explicit KDateTime(const QDate &date, const Spec &spec = Spec(LocalZone));
                                                             ^
/usr/include/kdatetime.h:245:45: note: default argument declared here           
        Spec(SpecType type, int utcOffset = 0);
                                            ^
/usr/include/kdatetime.h:554:72: error: use of default argument to function
'Spec' that is declared later in class 'Spec'                         
    KDateTime(const QDate &date, const QTime &time, const Spec &spec =
Spec(LocalZone));
                                                                       ^
/usr/include/kdatetime.h:245:45: note: default argument declared here           
        Spec(SpecType type, int utcOffset = 0);
                                            ^

It can be seen from line numbers that the default argument is really defined
earlier, not later.

This can be reproduced like this:
- have kdelibs (4.4)
- compile the file a.cpp "#include <kdatetime.h>" with something like "clang++
-c -I/usr/include/qt4 a.cpp"

kdatetime.h:
http://websvn.kde.org/branches/KDE/4.4/kdelibs/kdecore/date/kdatetime.h?revision=1154417&view=markup

-- 
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.



More information about the llvm-bugs mailing list