Skip to content
Commit 3c2713ac authored by Jordan Rose's avatar Jordan Rose
Browse files

[analyzer] Don't use the address of a temporary CFGElement.

GCC destroys temporary objects more aggressively than clang, so this
results in incorrect behavior when compiling GCC Release builds.

We could avoid this issue under C++11 by preventing getAs from being
called when 'this' is an rvalue:

  template<class ElemTy> const ElemTy *getAs() const & { ... }
  template<class ElemTy> const ElemTy *getAs() const && = delete;

Unfortunately, we do not have compatibility macros for this behavior yet.

This will hopefully fix PR13760 and PR13762.

llvm-svn: 163402
parent b759ede9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment