[LLVMbugs] [Bug 14671] New: Syntax error when parsing a constructor declaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 20 08:08:05 PST 2012


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

             Bug #: 14671
           Summary: Syntax error when parsing a constructor declaration
           Product: clang
           Version: 3.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: crunchykt at fea.st
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9745
  --> http://llvm.org/bugs/attachment.cgi?id=9745
Affected header file, reduced to just the offending declaration and necessary
other declarations and includes

When parsing one of my headers, Clang++ fails with syntax errors on the
declaration of a constructor. This happens on both Clang 3.1 on Linux and Apple
Clang on OS X 10.8. The code is correct and compiles (and runs) fine on GCC and
MSVC.

I've attached a stripped down header file with just the offending line and
necessary includes/declarations.

Given the command line:
clang++ Dummy.cpp -fsyntax-only -I/usr/local/include/QtGui
-I/usr/local/include/QtCore

the following errors arise:

In file included from Dummy.cpp:1:
./KtWorkspaceApp.hpp:13:128: error: expected ')'
        const QHash<QString, KtWorkspaceWorksheetHandler *> &
worksheet_handlers = QHash<QString, KtWorkspaceWorksheetHandler *>(), const
QStringList & default_worksheet_class = QStringList());
                                                                               
                                               ^
./KtWorkspaceApp.hpp:12:28: note: to match this '('
    explicit KtWorkspaceApp(int & argc, char ** argv, bool single_instance,
const QString & appName, const QString & appVer, const QString & orgName, const
QString & orgDomain = QString(), const QIcon & appIcon = QIcon(),
                           ^
./KtWorkspaceApp.hpp:13:97: error: expected '>'
        const QHash<QString, KtWorkspaceWorksheetHandler *> &
worksheet_handlers = QHash<QString, KtWorkspaceWorksheetHandler *>(), const
QStringList & default_worksheet_class = QStringList());
                                                                               
                ^
./KtWorkspaceApp.hpp:13:128: error: missing default argument on parameter
        const QHash<QString, KtWorkspaceWorksheetHandler *> &
worksheet_handlers = QHash<QString, KtWorkspaceWorksheetHandler *>(), const
QStringList & default_worksheet_class = QStringList());
                                                                               
                                               ^
3 errors generated.

I'm compiling against Qt 4.8. Dummy.cpp is empty except for the include line
for the header file.

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