summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2f95b84)
2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grok_reference_init): Improve error location.
(grokdeclarator): Likewise, improve two locations.
/testsuite
2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/diagnostic/constexpr2.C: New.
* g++.dg/diagnostic/ref3.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267756
138bc75d-0d04-0410-961f-
82ee72b054a4
+2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * decl.c (grok_reference_init): Improve error location.
+ (grokdeclarator): Likewise, improve two locations.
+
2019-01-08 Marek Polacek <polacek@redhat.com>
PR c++/88538 - braced-init-list in template-argument-list.
2019-01-08 Marek Polacek <polacek@redhat.com>
PR c++/88538 - braced-init-list in template-argument-list.
if ((DECL_LANG_SPECIFIC (decl) == 0
|| DECL_IN_AGGR_P (decl) == 0)
&& ! DECL_THIS_EXTERN (decl))
if ((DECL_LANG_SPECIFIC (decl) == 0
|| DECL_IN_AGGR_P (decl) == 0)
&& ! DECL_THIS_EXTERN (decl))
- error ("%qD declared as reference but not initialized", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%qD declared as reference but not initialized", decl);
unqualified_id);
else if (constexpr_p && !initialized)
{
unqualified_id);
else if (constexpr_p && !initialized)
{
- error ("%<constexpr%> static data member %qD must have an "
- "initializer", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%<constexpr%> static data member %qD must "
+ "have an initializer", decl);
}
else if (constexpr_p && DECL_EXTERNAL (decl))
{
}
else if (constexpr_p && DECL_EXTERNAL (decl))
{
- error ("declaration of %<constexpr%> variable %qD "
- "is not a definition", decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "declaration of %<constexpr%> variable %qD "
+ "is not a definition", decl);
+2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/diagnostic/constexpr2.C: New.
+ * g++.dg/diagnostic/ref3.C: Likewise.
+
2019-01-08 Marek Polacek <polacek@redhat.com>
PR c++/88538 - braced-init-list in template-argument-list.
2019-01-08 Marek Polacek <polacek@redhat.com>
PR c++/88538 - braced-init-list in template-argument-list.
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+extern constexpr int i __attribute__((unused)); // { dg-error "22:declaration of .constexpr. variable .i." }
+
+struct S
+{
+ constexpr static int i __attribute__((unused)); // { dg-error "24:.constexpr. static data member .i." }
+};
--- /dev/null
+int& i __attribute__((unused)); // { dg-error "6:.i. declared as reference" }