2015-08-12 Jason Merrill <jason@redhat.com>
+ PR c++/67108
+ * decl2.c (c_parse_final_cleanups): Set at_eof to 2 at end.
+ * error.c (dump_template_bindings): Don't tsubst in that case.
+
PR c++/67161
* error.c (dump_decl) [TEMPLATE_ID_EXPR]: Pass
TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS.
#endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
\f
-/* Nonzero if we're done parsing and into end-of-file activities. */
+/* Nonzero if we're done parsing and into end-of-file activities.
+ Two if we're done with front-end processing. */
extern int at_eof;
timevar_stop (TV_PHASE_DEFERRED);
timevar_start (TV_PHASE_PARSING);
+
+ /* Indicate that we're done with front end processing. */
+ at_eof = 2;
}
/* Perform any post compilation-proper cleanups for the C++ front-end.
&& !DECL_LANG_SPECIFIC (current_function_decl))
return;
+ /* Don't try to do this once cgraph starts throwing away front-end
+ information. */
+ if (at_eof >= 2)
+ return;
+
FOR_EACH_VEC_SAFE_ELT (typenames, i, t)
{
if (need_semicolon)
--- /dev/null
+// PR c++/67108
+// { dg-do compile { target c++11 } }
+
+template < typename, typename > struct is_same;
+template < typename T > struct is_same <T, T >
+{
+ enum
+ {
+ value = true
+ }
+ ;
+ constexpr bool operator () ()
+ {
+ return value;
+ }
+}
+ ;
+template < bool, typename = void >struct enable_if;
+template < typename T > struct enable_if <true, T >
+{
+ typedef T type;
+}
+ ;
+struct A;
+template < typename, typename = void >struct F;
+template < typename X > struct F <X, typename enable_if < is_same < X, A >
+{
+}
+ () >::type >
+{
+ template < typename MakeDependent > F (MakeDependent)
+ {
+ }
+}
+;
+
+int main ()
+{
+ F < A > (1);
+}