[LLVMbugs] [Bug 13288] New: Crash on invalid

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 6 14:48:45 PDT 2012


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

             Bug #: 13288
           Summary: Crash on invalid
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jason.haslam at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This crashes in C mode but not C++. Consider:

jason$ cat test.c 
//typedef int unknown_t;

static unknown_t get();
static unknown_t get() {}

void test()
{
  unknown_t unknown;
  unknown = get();
}

jason$ clang -fsyntax-only test.c 
/Users/jason/Desktop/overload/test.c:3:8: error: unknown type name 'unknown_t'
static unknown_t get();
       ^
/Users/jason/Desktop/overload/test.c:4:8: error: unknown type name 'unknown_t'
static unknown_t get() {}
       ^
/Users/jason/Desktop/overload/test.c:8:3: error: use of undeclared identifier
'unknown_t'
  unknown_t unknown;
  ^
/Users/jason/Desktop/overload/test.c:9:3: error: use of undeclared identifier
'unknown'
  unknown = get();
  ^
Assertion failed: (Proto && "Functions without a prototype cannot be
overloaded"), function AddOverloadCandidate, file
/Users/jason/Sources/llvm/tools/clang/lib/Sema/SemaOverload.cpp, line 5217.
Stack dump:
0.    Program arguments: /Users/jason/Sources/llvm/build/debug/bin/clang-3.2
-cc1 -triple x86_64-apple-macosx10.7.0 -fsyntax-only -disable-free
-main-file-name test.c -pic-level 2 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -resource-dir
/Users/jason/Sources/llvm/build/debug/bin/../lib/clang/3.2 -fmodule-cache-path
/var/folders/lf/36_5tdts1953gfg4mjwfmq8h0000gn/T/clang-module-cache
-fdebug-compilation-dir /Users/jason/Sources/llvm/build/debug/bin -ferror-limit
19 -fmessage-length 173 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.7.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -x c /Users/jason/Desktop/overload/test.c 
1.    /Users/jason/Desktop/overload/test.c:9:17: current parser token ')'
2.    /Users/jason/Desktop/overload/test.c:7:1: parsing function body 'test'
3.    /Users/jason/Desktop/overload/test.c:7:1: in compound statement ('{}')
...

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