tags:

views:

42

answers:

1

I am using CLang but on using -ast-dump option I do not get the desired output

Code

 ram@ram-desktop ~ $ cat a.cpp
 class A{};

 ram@ram-desktop ~ $ clang++  -cc1 -ast-dump a.cpp
 typedef char *__builtin_va_list;
 class A {
    class A;
 };
 ram@ram-desktop ~ $ 

I thought I would be getting something like that mentioned by litb in this thread. I wanted to see the default functions generated by the compiler but I could not see it. What could be the problem

Also -Wall option doesn't generate warnings as required

For example

I have the following code (a.cpp)

  int main()
  {

       int a=10;
       a=a++*++a; //Operation on a may be undefined (gcc warning)

  }

On using clang -Wall a.cpp I do not get any warning. Is there any problem with my compiler or is this the default behaviour?

A: 

My clang build with svn revision r107066 does show the generated functions.

About ++a++ and such: The compiler is not required to detect such programming errors and it is not required to warn about them. It seems like gcc has added detection for such problems while clang hasn't.

sth