Skip to content
Commit 0528a31d authored by Faisal Vali's avatar Faisal Vali
Browse files

Fix PR28366: Handle variables from enclosing local scopes more gracefully...

Fix PR28366: Handle variables from enclosing local scopes more gracefully during constant expression evaluation.

Only look for a variable's value in the constant expression evaluation activation frame, if the variable was indeed declared in that frame, otherwise it might be a constant expression and be usable within a nested local scope or emit an error.


void f(char c) { 
  struct X {
    static constexpr char f() { 
      return c; // error gracefully here as opposed to crashing.
    }
  };
  int I = X::f();
}

llvm-svn: 286748
parent e706c1d9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment