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

            Bug ID: 17641
           Summary: Clang tutorial # 2 crash
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

I've downloaded and compiled tutorial from here:
https://github.com/loarabia/Clang-tutorial/blob/master/tutorial2.cpp

For input, I've a simple "hello world", with one #include
(The #include is part of the problem)

The program crashes here:
file: Lex\HeaderSearch.h
code: 
-----------------------------------------------------
HeaderSearchOptions &getHeaderSearchOpts() const { 
      return *HSOpts;  <-- crash
  }
-----------------------------------------------------
because HSOpts is null.

My bypass was to change the tutorial example,
from:
llvm::IntrusiveRefCntPtr<clang::HeaderSearchOptions> hso;
to:
llvm::IntrusiveRefCntPtr<clang::HeaderSearchOptions> hso(new
clang::HeaderSearchOptions);

(ignore the memory leak)

But the issue is the crash is not nice welcome when you try a tutorial (:

Anyways, Clang is very good and thanks for everyone who work on this project !

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