[cfe-commits] [PATCH] Fix for crash on invalid in microsoft anonymous struct extension

Nico Weber thakis at chromium.org
Tue Jan 31 14:55:33 PST 2012


Thanks for the patch! Can you include a test case? See e.g.
test/Sema/ms_class_layout.cpp for an example.

Nico

On Tue, Jan 31, 2012 at 2:33 PM, Jason Haslam <jason.haslam at gmail.com> wrote:
> The attached trivial patch fixes PRĀ 11847. From the PR:
>
> The following invalid program crashes clang:
>
> jason$ cat test.c
> typedef struct { UNKNOWN c; } A;
> typedef struct { A; } B;
>
> jason$ clang -target i386-pc-win32 test.c
> test.c:1:18: error: unknown type name 'UNKNOWN'
> typedef struct { UNKNOWN c; } A;
>                  ^
> test.c:2:18: warning: anonymous structs are a Microsoft extension
> [-Wmicrosoft]
> typedef struct { A; } B;
>                  ^
> Stack dump:
> 0.    Program arguments:
> /Users/jason/Sources/llvm/build/release/bin/clang-3.1
> -cc1 -triple i386-pc-win32 -emit-obj -mrelax-all -disable-free
> -disable-llvm-verifier -main-file-name test.c -mrelocation-model static
> -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4
> -momit-leaf-frame-pointer -resource-dir
> /Users/jason/Sources/llvm/build/release/bin/../lib/clang/3.1
> -fmodule-cache-path...
>
> Please apply.
>
> Jason
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list