initialized from a non-value-dependent initializer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363622
91177308-0d34-0410-b5e6-
96231b3b80d8
// declaration is encountered...
const VarDecl *DefVD = nullptr;
const Expr *Init = getAnyInitializer(DefVD);
- if (!Init || Init->isValueDependent())
+ if (!Init || Init->isValueDependent() || getType()->isDependentType())
return false;
// ... if it is a constexpr variable, or it is of reference type or of
// const-qualified integral or enumeration type, ...
};
}
+namespace test6 {
+ template<typename T> T f() {
+ const T &v(0);
+ return v;
+ }
+ int use = f<int>();
+}
+
namespace PR8795 {
template <class _CharT> int test(_CharT t)
{