-fdelayed-template-parsing causes crash on Windows during static analysis

Hi there,

I’ve been experimenting with the static analyzer on Windows. I have it working now, but came across the following issue -

  1. Compiled LLVM+Clang 3.7.0 in Visual Studio 13 (MSVC 18)
  2. Got the full list of compilation options for clang by running

clang -### -c hello.cpp

The list of options includes "fdelayed-template-parsing

  1. Used these options as input to

clang -cc1 -analyze -analyzer-checker=core hello.cpp

  1. clang crashes with a null pointer exception on clang::Stmt::getStmtClass()

‘hello.cpp’ is simply:

#include

int main() {
std::cout << “Hello, Static Analysis World” << std::endl;
return 0;
}

A simpler program, without including any STL headers, works.

Removing the ‘-fdelayed-template-parsing’ option allows static analysis to complete as normal.

Cheers!
Andrew.

Hi there,

I've been experimenting with the static analyzer on Windows. I have it working now, but came across the following issue -

1. Compiled LLVM+Clang 3.7.0 in Visual Studio 13 (MSVC 18)
2. Got the full list of compilation options for clang by running

clang -### -c hello.cpp

The list of options includes "fdelayed-template-parsing

3. Used these options as input to

clang -cc1 <options> -analyze -analyzer-checker=core hello.cpp

4. clang crashes with a null pointer exception on clang::Stmt::getStmtClass()

'hello.cpp' is simply:

#include <iostream>

int main() {
  std::cout << "Hello, Static Analysis World" << std::endl;
  return 0;
}

A simpler program, without including any STL headers, works.

Removing the '-fdelayed-template-parsing' option allows static analysis to complete as normal.

We should at least provide a better user experience here, reporting that the options are incompatible.