Skip to content

Commit

Permalink
[dcl.spec.auto] Add example to show variable redeclaration with 'auto'.
Browse files Browse the repository at this point in the history
CWG2389 Agreement of deduced and explicitly-specified variable types
  • Loading branch information
jensmaurer authored and zygoloid committed Oct 6, 2019
1 parent eaf2372 commit 901b742
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,12 @@
friend T frf(T);
};
auto frf(int i) { return i; } // not a friend of \tcode{A<int>}
extern int v;
auto v = 17; // OK, redeclares \tcode{v}
struct S {
static int i;
};
auto S::i = 23; // OK
\end{codeblock}
\end{example}

Expand Down

0 comments on commit 901b742

Please sign in to comment.