PR17938: This has already been fixed, add regression test.

llvm-svn: 229146
This commit is contained in:
Richard Smith 2015-02-13 19:49:59 +00:00
parent ec216500f2
commit 46598206b5
1 changed files with 10 additions and 0 deletions

View File

@ -1984,3 +1984,13 @@ struct InvalidRedef {
int f; // expected-note{{previous definition is here}}
constexpr int f(void); // expected-error{{redefinition of 'f'}} expected-warning{{will not be implicitly 'const'}}
};
namespace PR17938 {
template <typename T> constexpr T const &f(T const &x) { return x; }
struct X {};
struct Y : X {};
struct Z : Y { constexpr Z() {} };
static constexpr auto z = f(Z());
}