Skip to content
Commit 72c57f49 authored by Nico Weber's avatar Nico Weber
Browse files

Fix rejects-valid caused by r261297.

r261297 called hasUserProvidedDefaultConstructor() to check if defining a
const object is ok.  This is incorrect for this example:

  struct X { template<typename ...T> X(T...); int n; };
  const X x; // formerly OK, now bogus error

Instead, track if a class has a defaulted default constructor, and disallow
a const object for classes that either have defaulted default constructors or
if they need an implicit constructor.

Bug report and fix approach by Richard Smith, thanks!

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